ActiveReports 11
Silverlight Viewer
ActiveReports 11 > ActiveReports User Guide > Samples and Walkthroughs > Samples > Professional > Silverlight Viewer

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 11\Professional\SilverLightViewer\VB.NET

C#

<User Folder>\GrapeCity Samples\ActiveReports 11\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

The Images folder contains images that are used in the header of the ActiveReports 11 Silverlight Viewer, including the images for the buttons to load and display an RDF, an RDLX, an RPX and a Code report in the Silverlight Viewer.

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 11 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

The Invoice report that is displayed in the Silverlight Viewer by clicking the Code button in the header of the Viewer.

Invoice Report

The Invoice report uses a PageHeader, a GroupHeader, a Detail section, a GroupFooter and a PageFooter section.

PageHeader

This section contains Label, Textbox, Shape and Line controls to create the report page header.

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

This section contains bound TextBox controls. These TextBoxes render once for each row of data found in the current OrderID before the report moves on to the GroupFooter section.

customerGroupFooter

The NewPage property of this section is set to After. This causes the report to break to a new page and generate a new invoice after this section prints its subtotals.

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

This section has one simple ReportInfo control. For more information about report sections and the order in which they print, see Section Report Structure and Section Report Events.

Default.html

This is the html page that hosts the Silverlight Viewer in the browser.

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.

See Also

Getting Started

Concepts