CHAPTER 9 RENDERING REPORTS FROM .NET APPLICATIONS
Rendering the Report Locally
We’ll now cover how to render the report locally without using an SSRS 2012 server. It is a bit more
complicated because you’re responsible for filling the data sources with the data that your reports
require. However, it does provide tremendous flexibility to the developer because you can use SSRS 2012
reporting features without a server.
Caution The server and local report definition files are not 100 percent compatible. This means it is not
possible to use the same RDL source file for both local and remote use. In fact, you will note that by default reports
for server-side or remote processing are created with the .rdl extension and reports for client-side or local
processing are created with the .rdlc extension. While they are not 100 percent interchangeable, you can use one
for the other with some changes to the underlying RDL.
Creating the Report’s Data Source
First, you will add a data source to your project by adding the dataset you created previously. To add the
data source, follow these steps:
- In the Project Explorer, right-click the project name SSRS Viewer RVC, point to
Add, and select Existing Item. - Navigate to the folder containing the Chapter 9 examples, and select
EmployeePay.xsd in the SRSS Viewer RVC folder. This is the XML schema file
you’ll use to define your data source for the report. When you add the .xsd file
to your project, it will also appear under the Data Sources window. If you don’t
see the Data Sources window, select Data ➤ Show Data Sources from the
menu.
Note Alternatively, you could have used the Data Source Configuration Wizard found by selecting Data ➤ Add
New Data Source. With it you can create several types of data sources including those sourcing from a database, a
Web service, or even an object. Just remember that, much like this example, it is up to you to retrieve the data and
populate the data source with it.
Next you’ll create a local RDL (.rdlc) that you’ll render using the Report Viewer control in local
processing mode.