We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to export a report without viewing in ReportViewer

Platform: LightSwitch Silverlight |
Control: ReportViewer |
.NET Framework: 4.5.1

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.


Stream rdlStream = this.GetType().Assembly.GetManifestResourceStream("LightSwitchApplication.ReportTemplate.GroupingAggReport.rdlc");
ReportWriter writer = new ReportWriter();
writer.ReportProcessingMode = ProcessingMode.Local;
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:



You must log in to leave a comment
Nicolas Lope de Barrios
Mar 08, 2016
Hi, this seems like a very helpful sample, since I need to be able to save the report as PDF to disk, using code, and the stream approach might work. However, the sample does not work: it doesn't show any data in the viewer, and when editing the report Dataset (Sales) there is no Data Source (AdventureWorks), as if the connection is missing. Can you, please, update the sample with one that actually works, or specify the requirements? I'm using Visual Studio 2013 update 5 with ReportViewer for SL LightSwitch Thanks. Nico Reply
Nicolas Lope de Barrios
Mar 08, 2016
Hi, I just realize that the report might not display data on purpose, because of the article's title ("How to print a report without viewing in ReportViewer"). But it should print the report as PDF to the default printer, which does not work either. Reply
Vinoth Srinivasan [Syncfusion]
Mar 11, 2016
We refreshed the KB with modified application and updated content. Reply

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile