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. |
Toolbar element | Name | Description |
---|---|---|
Toggle Sidebar | Displays the sidebar that includes the Search, TOC (Table of Contents), and Parameters panes. | |
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 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. |
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.
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.
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 7 Web Service. This adds ActiveReports.ReportService1.asmx to your project.
- From the Toolbox ActiveReports 7 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.
- 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
- Limitations on printing:
- ActiveReports Silverlight Viewer does not provide the one-touch printing option.
- The maximum value for the print range is 2000 pages.
- Vertical text is not supported in the ActiveReports Silverlight Viewer.
- Horizontal and vertical text of MS PMincho and some other ideographic characters may render incorrectly in the ActiveReports Silverlight Viewer.
- The use of the Silverlight Viewer control in layout panels has a limitation related to the default size of the panel.
- The multipage mode is not available in the ActiveReports Silverlight Viewer.
- To display a report with annotations in the Thumbnails view correctly, hide the Thumbnails view by clicking the Show TOC/Thumbnails icon in the Toolbar and then open the report in the Silverlight Viewer.
- IIS Express setting needs to be done when loading an RDF file in the Viewer using client-side scripts. For more details, go to the Silverlight Viewer Troubleshooting section in Troubleshooting.
- Some Silverlight properties and events are not supported in XAML. However, you can still use these properties by setting them in code as follows:
Visual Basic.NET code. Add this code in an event like Button_Click. Copy Code Viewer1.FontStyle = FontStyles.Italic C# code. Add this code in an event like Button_Click. Copy Code viewer1.FontStyle = FontStyles.Italic; Silverlight properties and events that are not supported
Properties
- FontStyle
- FontWeight
- FontFamily
- FontSize
- Foreground
- FontStretch
- Padding
- VerticalContentAlignment
- HorizontalContentAlignment
- IsTabStop
Events
- GotFocus
- LostFocus