Articles in this section
Category / Section

How to export a report without viewing in ReportViewer

1 min read

LIGHTSWITCH Silverlight Report Viewer does not support to Export the reports directly without viewing. Instead you can use Report Writer to achieve the exporting of reports. Initialize the Report Writer with report stream, data source and save report to PDF format using the Save as like below code sample.

C#

Stream rdlStream = this.GetType().Assembly.GetManifestResourceStream("LightSwitchApplication.ReportTemplate.GroupingAggReport.rdlc");
ReportWriter writer = new ReportWriter();
writer.ReportProcessingMode = ProcessingMode.Local;
writer.LoadReport(rdlStream);
writer.DataSources.Add(new ReportDataSource { Name = "Sales", Value = items });
writer.ExportCompleted += writer_ExportCompleted;
writer.Save(System.IO.Path.GetTempPath() + "Exported_Report.pdf", WriterFormat.PDF);

 

 

Sample Link:

https://www.syncfusion.com/downloads/support/directtrac/general/ze/Silent_Export-222019917

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments
Please sign in to leave a comment
Access denied
Access denied