I'm working on solution to generate SSRS report in memory to attach after as mail attachment. I'm using 2010 version.
Report has required parameters that should be filled to render report correct.
I found few solution how to do this:
Solution 1
Using MS native ReportViewer class. We can instantiate object in memory, connect to server and render report in required format using control API
report.ServerReport.ReportServerCredentials = new MyCredentials(...);
report.ServerReport.ReportServerUrl = new Uri("ssrs_url");
report.ServerReport.ReportPath = "path-to-report";
byte[] reportData = report.ServerReport.Render("excel");
The solution have main drawback - it requires significant set of dependencies to use reporting control. So it hard to use in layered architecture, when lower layers have limited and predefined set of dependencies to be loose coupled and be easy ported to wide range OS'es and cloud stacks.
So can't adopt this solution in my case
Solution 2
Use report server public API to access data already in required format. I found out that this can be achieved and MS confirms this. Here is link https://msdn.microsoft.com/en-us/library/ms154040.aspx
So we can just use right configured link to access data: http://myrshost/ReportServer?/myreport&rs:Format=PDF
This solution best suited for my needs, but I don't know how to pass report parameters to this report? Also how to authenticate first against SSRS report server?
Can someone help me with this?