This article helps you to explain the steps for loading RDLC report in ReportViewer LightSwitch HTML Control, process it with local mode and bind the data source to the report.
When you are new to ReportViewer LightSwitch HTML, you can read Getting started with ReportViewer LightSwitch HTML from the previous article available in the following link.
Load RDLC Report
The ReportViewer has an option to load RDL/RDLC reports and process them locally. The following steps help you to load a RDLC report file from server application and bind data to the report at server.
1. Add a New Folder in Server Project and name it as ReportTemplate.
2. Copy and paste the sample RDLC report file Sales Dashboard.rdlc to ReportTemplate folder. Content and resource items in a LightSwitch project are not deployed with the application by default. You can deploy these items by changing some properties for the file. Change the Build Action property for report file as Content and Copy to Output Directory as Copy always.
Figure 1: RDLC File Added to Server Project
Note: You can obtain sample rdlc file “Sales Dashboard.rdlc” from Syncfusion samples installed location(%userprofile%\AppData\Local\Syncfusion\LightSwitch\X.X.X.X\HTML\2013\SampleBrowser\SampleBrowser.Server\ReportTemplate). “X.X.X.X” is the Essential Studio Release Version.
3. For processing the RDLC reports locally, you have to set ReportViewer’s reportPath as desired rdlc file name(Sales Dashboard.rdlc) and processingMode as ej.ReportViewer.ProcessingMode.Local
4. Set RDLC file path from sample application at WebApi OnInitReportOptions
5. You can bind the data source to ReportViewer control either at OnInitReportOptions or at OnReportLoaded methods.
Run the Application
Run the sample application and you can see the ReportViewer with Sales Dashboard report on the page as displayed in the following screenshot.
Figure 2: ReportViewer with Sales Dashboard Report
You can download the Demo Sample from the following link.
Local Report (RDLC) Sample
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:||.NET Framework:|