Reputation: 4950
I am trying to figure out if it's possible to export a ssrs report from C#. Report is running using ReportViewer in a local mode with no SSRS server available. I have gone through many examples. Seems like they are all showing code when SSRS report is in place. If no export with no SSRS server is not possible, can I at least use the following Example
which shows how SSRS web Services endpoints can be used. I am not a C# developer so I dont know if it's possible to use SSRS web services without installing the SSRS server somewhere.
Please help.
Thanks
Upvotes: 0
Views: 1857
Reputation: 483
it is possible. im using reportviewer for local reportprocessing to generate pdfs from rdl files. its along the line of how you can use it.
in my experience this approach can cause issues with multithreading
using Microsoft.Reporting.WinForms;
using Warning = Microsoft.Reporting.WinForms.Warning;
var viewer = new ReportViewer { ProcessingMode = ProcessingMode.Local };
var localReport = viewer.LocalReport;
localReport.LoadReportDefinition([stream from rdl]);
localReport.DataSources.Clear();
localReport.DataSources.Add(new ReportDataSource
{
Name = dataSet.Name,
Value = [USE DATATABLE THAT HAS THE SAME STRUCTURE THAN YOUR DATASOURCE]
});
Warning[] warningslocal = null;
string encoding;
string[] streamIds;
string mimeType;
string extension;
var result = localReport.Render(format, deviceInfo, out mimeType, out encoding, out extension,
out streamIds, out warningslocal);
Upvotes: 1