The Silverlight Viewer sample demonstrates the Silverlight Viewer with its various options of loading RPX, RDLX, and RDF reports. This Sample is part of the ActiveReports Professional Edition.
Sample Location
Visual Basic.NET
<User Folder>\GrapeCity Samples\ActiveReports 12\Professional\SilverLightViewer\VB.NET
C#
<User Folder>\GrapeCity Samples\ActiveReports 12\Professional\SilverLightViewer\C#
Run-Time Features
When you run the project, the MainPage.xaml page with the Silverlight Viewer displaying the MainReport.rpx appears in your browser, and you will see a number of report options that the Silverlight Viewer will display.
Project Details
Images
MainPage.xaml
The user control that contains the Silverlight Viewer. The code behind this file, MainPage.xaml.vb (or .cs), handles the customization of the Silverlight Viewer application.
It contains code that handles the display of RDF, RDLX, RPX, and Code reports in the ActiveReports 12 Silverlight Viewer.
SilverlightViewer.Web Project
Reports
The Reports folder that contains the RDF, RDLX and RPX files of reports used in the sample. You can alter the project and add your own reports to this folder.
RDF
The EmployeeSales.rdf report that is displayed in the Silverlight Viewer by clicking the RDF button in the header of the Viewer.
The report displays the Sales by Employee chart and the list of employee names in the alphabetical order along with their total sales.
RDLX
The SalesReport.rpx is displayed in the Silverlight Viewer by clicking the RDLX button in the header of the Viewer. This report presents the Sales over time line chart along with the list of chart data.
The report contains two parameters, StartDate and EndDate. The report also has one TextBox with the Label property set to the expression, thus you can see the Document map of the report in the sidebar pane.
RPX
The Invoice1.rpx and MainReport.rpx reports. The Invoice1.rpx report is displayed in the Silverlight Viewer by clicking the RPX button in the header of the Viewer. The report displays the invoice form and the invoice details.
The MainReport.rpx report is the default report to be displayed in the Viewer when you run the sample project.
ActiveReports.ReportService.asmx
The report web service required for the proper functioning of the Silverlight Viewer. The ActiveReports.ReportService.asmx is added automatically to the project when you place the Viewer control on the form. You can also can add this service by using Add New Item in the Visual Studio 2010 Project menu.
For the information on how to use the Silverlight Viewer, see Using the Silverlight Viewer.
CodeReport
Invoice Report
The Invoice report uses a PageHeader, a GroupHeader, a Detail section, a GroupFooter and a PageFooter section.
PageHeader
customerGroupHeader
The DataField property of this section is set to OrderID. This setting, in conjunction with data ordered by the OrderID field, causes the report to print all of the information for one order ID value, including all of the related details and footers, before moving on to the next order ID. For more information on grouping, see Grouping Data in Section Reports.
This section also contains the Line, Shape, CrossSection controls, a number of Label controls, and two bound TextBox controls. The TextBoxes are bound using the DataField property in the Properties window.
In the lower part, the section contains labels for the data to follow in the Detail section.
Detail
customerGroupFooter
This section contains several labels and several TextBoxes. The subtotalTextBox control uses the following properties to summarize the detail data: SummaryRunning, SummaryGroup, and SummaryType. For more information, Create a Summary Report.
The Total TextBox does not use the DataField property or any of the summary properties, or even any code. To find the functionality of this TextBox, in design view, click the Script tab at the bottom of the report.
PageFooter
Default.html
Report.aspx
This report contains the code to run the CodeReport, generate it in the rdf format and pass it to the Silverlight Viewer for display. This report is processed by the code of MainPage.xaml when you click the Code button in the Silverlight Viewer header.
Web.config
The configuration file that contains the httpHandlers that allow ActiveReports to process reports on the Web.
Note that you need to manually update version information here when you update your version of ActiveReports.