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
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:
- Enter the word or phrase in the search field.
- 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.
- Click the Search button to see the results appear in the Find results list.
- 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.
- In the Parameters pane, you are prompted to enter a value by which to filter the data to display.
- 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)
- Create a new Silverlight project or open an existing one, ensuring that the Silverlight Version option is set to Silverlight 4 or higher.
- In the Visual Studio Solution Explorer, right-click YourProject.Web and select Add, then New Item.
- In the Add New Item dialog that appears, select the Reporting template, then select ActiveReports 8 Web Service. This adds ActiveReports.ReportService1.asmx to your project.
- From the Toolbox tab, drag the Viewer control and drop it on the design view of MainPage.xaml.
- In the Solution Explorer, right-click YourProject.Web and select Add, then Existing Item and select an existing report to load in the viewer.
- On MainPage.xaml, with the viewer selected, go to the Properties window and double click the Loaded event.
- 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 runtime, 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
- In the Silverlight viewer toolbar, click the Print button.
- 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 Provide PDF Printing in the Silverlight Viewer (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