ActiveReports 11
Silverlight Viewer
ActiveReports 11 > ActiveReports User Guide > Viewing Reports > Silverlight Viewer

ActiveReports provides a Silverlight Viewer to where you can load and view your reports. This viewer contains a toolbar and a sidebar with Search, Table of Contents and Parameters panes.

Note: Microsoft Silverlight 4 Tools are required for application development with the ActiveReports Silverlight Viewer.

Silverlight Viewer toolbar

Toolbar element Name Description
Toggle Sidebar Displays the sidebar that includes the Search, TOC (Table of Contents), and Parameters panes.
Print Displays the Print dialog where you can specify the printing options.
Find Displays the Search pane in the sidebar.
Zoom out Decreases the magnification of your report.
Zoom reset Resets the magnification to default 
Zoom slider Allows you to drag the slider to increase or decrease the magnification of your report.
Zoom in Increases the magnification of your report.
Fit page width Fits the width of the page according to viewer dimensions.
Fit whole page Fits the whole page within the current viewer dimensions.
First page Takes you to the first page of the report. This button is enabled when a page other than the first page is open.
Previous page Takes you to the page prior to the current page. This button is enabled when a page other than the first page is open.
Current page Shows the current page number and opens a specific page in the report. To view a specific page, type the page number and press the Enter key.
Next page Takes you to the page following the current page. This button is disabled on reaching the last page of the report.
Last page Takes you to the last page of the report. This button is disabled on reaching the last page of the report.
Backward Takes you to the last viewed page. This button is enabled when you move to any page from the initial report page. Clicking this button for the first time also enables the Forward button.
Forward Takes you to last viewed page before you clicked the Backward button. This button is enabled once you click the Backward button.
Back to Parent Report Returns to the parent report in a drillthrough page or RDL report.
Export Format Allows you to specify the export format for a report. You can select from the following options: PDF, Excel, HTML, Word, or XML.
Export Report Exports a report into the selected format.

Silverlight Viewer Sidebar

Search Pane

The Search pane appears by default in the sidebar when you click the Toggle Sidebar button. This pane lets you enter a word or phrase to search within the report.

To search in a report:

  1. Enter the word or phrase in the search field.
  2. Under Use this additional criteria, you may optionally choose to search for the whole word or match the case of the search string while searching in the report.
  3. Click the Search button to see the results appear in the Find results list.
  4. Click an item in the list to jump to that item in the report and highlight it.

To start a new search or clear the current search results, click the Clear button under the Find results list.

Table of Contents (TOC) Pane

To display the Table of Contents pane, in the toolbar, click Toggle Sidebar. Then at the bottom of the sidebar, click the Table of Contents button.

If a report does not have the Label property or Document map label set, the Table of Contents (TOC) pane does not appear in the sidebar.

Parameters Pane

The Silverlight Viewer allows you to view reports with parameters. In the toolbar, click the Toggle sidebar button to open the sidebar and if your report contains parameters, the Parameters pane shows up automatically.

  1. In the Parameters pane, you are prompted to enter a value by which to filter the data to display.
  2. Enter a value or set of values and click View report, to filter the report data and display the report.

If a report does not have parameters, the Parameters pane does not appear in the sidebar.

Display the report in the Viewer

Set up your Silverlight project using the following steps: (see the Silverlight walkthrough for more details)

  1. Create a new Silverlight project or open an existing one, ensuring that the Silverlight Version option is set to Silverlight 4 or higher.
  2. In the Visual Studio Solution Explorer, right-click YourProject.Web and select Add, then New Item.
  3. In the Add New Item dialog that appears, select the Reporting template, then select ActiveReports 11 Web Service. This adds ActiveReports.ReportService1.asmx to your project.
  4. From the Toolbox  tab, drag the Viewer control and drop it on the design view of MainPage.xaml.  
  5. In the Solution Explorer, right-click YourProject.Web and select Add, then Existing Item and select an existing report to load in the viewer.
  6. On MainPage.xaml, with the viewer selected, go to the Properties window and double click the Loaded event.
  7. In the MainPage code view that appears, add code like the following to the viewer1_loaded event to bind the report to the viewer. This code shows an .rdlx report being loaded but you can use a .rpx report as well. 
    Visual Basic.NET code. Paste INSIDE the viewer1_Loaded event in MainPage.xaml.vb.
    Copy Code
    Viewer1.LoadFromService("YourReportName.rdlx")
    
    C# code. Paste INSIDE the viewer1_Loaded event in MainPage.xaml.cs.
    Copy Code
    viewer1.LoadFromService("YourReportName.rdlx");
    

To avoid evaluation banners appearing at run time, license your ActiveReports Silverlight project. You can find information on licensing ActiveReports Silverlight in License Your ActiveReports under To license an ActiveReports Silverlight project.

Silverlight Viewer printing

  1. In the Silverlight viewer toolbar, click the Print button.
  2. In the Print dialog that appears, select the printer settings and click Print

In addition to the standard Silverlight print option, you can setup PDF printing in your Silverlight project and print a document from Silverlight to the PDF format directly.

Note: PDF printing is not supported in the Silverlight Out-of-Browser applications.

See Silverlight PDF Printing (Pro Edition) to learn how you can set up and print a report from the Silverlight Viewer to PDF format.

Silverlight feature limitations

See Also

How To