In This Topic
The Active Reports WebViewer Pro Sample describes the standard ActiveReports web features as well as other features available in the Professional Edition only, such as HTTP handlers, custom PDF and HTML export, parameterized reports, and more.
An image describing the features available in the Professional Edition
Note: Before running this sample, in the Solution Explorer, click the Licenses.licx file and then, from the Build menu, select Build Runtime License. Please see To license Web Forms projects made on the trial version for details.
Sample Location
Visual Basic.NET
..\WebSamples14\JsViewerSamples\WebViewerPro_ASP.NET_VB.NET
C#
..\WebSamples14\JsViewerSamples\WebViewerPro_ASP.NET_C#
Details
When you run the sample, the Default.aspx page appears in your browser. This page provides links to other sample pages that demonstrate the following web features.
WebControl for ASP.NET: This link opens the WebControl.aspx page that allows you to select any of the three Viewer Types and it also allows you to select from Section, Page and RDL Report Type.
The three Viewer Types that are available are as follows:
- HtmlViewer
- AcrobatReader
- RawHtml
PWebControl.aspx page
HTTPHandlers: This link opens the HttpHandlers.aspx page with the http handler examples.
HttpHandlers.aspx page
Parameterized Report Example: This link opens the page that demonstrates how to generate a report by passing a parameter to the report.
Parameterized Report Example
Note: To run this sample, you must have access to the
Nwind.mdb. The NWIND.mdb file can be downloaded from
GitHub: ..\Samples14\Data\NWIND.mdb.
The project contains the following elements:
- CodeReports: The CodeReports folder contains the following reports - Invoice, InvoiceFiltered, NwindLabels and NwindLabelsFiltered. The code reports are used to demonstrate how the ActiveReports Compiled Report HttpHandler functions. For more details, see HttpHandlers.aspx below.
- PageReports: The PageReprorts folder contains the Invoice_Grouped and PurchaseReport report.
- RDLReports: The RdlxReports folder contains the SalesReceipt report.
- RPXReports: The RpxReports folder contains the following reports - Invoice, InvoiceFiltered, NwindLabels, NwindLabelsFiltered and Params. These reports are used to demonstrate how the RPX HttpHandlers function. For more details, see HttpHandlers.aspx below.
The Invoice.rpx report is used to demonstrate the WebViewer control options and is opened by clicking WebControl for ASP.NET on the Default.aspx page. This report is also opened by clicking the Custom Exporting PDF Example option on the Default.aspx page. For detailed information on the Invoice report, see the Cross Section Control Sample.
The NwindLabels report is opened by clicking the Custom Exporting HTML Example option on the Default.aspx page.
The Params report is used by the ParameterReport.aspx page to demonstrate how to generate a report by passing a parameter to the report.
- Default.aspx: This is the main Web form of the sample that shows the introductory text and links to the following sample pages.
- WebControl for ASP.NET (WebControl.aspx)
- HTTPHandlers (HttpHandlers.aspx)
- Custom Exporting PDF Example (Invoice report)
- Custom Exporting HTML Example (NWindLabels report)
- Parameterized Report Example(ParameterReport.aspx)
- HttpHandlers.aspx: ActiveReports provides HttpHandler components that allow ASP.NET to automatically process reports that have been placed into an ASP.NET web site folder. ActiveReports HttpHandler components enable easily deployable reports in both HTML and PDF file formats. ActiveReports includes a simple configuration utility to properly register the HttpHandler components with IIS and ASP.NET.
The RPX and RDLX HttpHandler processes and outputs reports from ActiveReports layout files (ending in the .rpx/.rdlx extension). When the ASP.NET receives a request for an ActiveReport file ending with the .rpx/.rdlx extension, the RPX/RDLX HttpHandler will run, and return the report's output in a format of your choice.
The compiled Report HttpHandler enables easy distribution of ActiveReports that use compiled .NET source code. Compiled reports are exposed as a .NET class in a .NET assembly file. When ASP.NET receives a request for a file with the .ActiveReport extension, the Compiled Report handler will load the ActiveReports from the assembly, run it, and return the output in a format of your choice.
For information on configuring the http handlers, see Configure HttpHandlers in IIS 8 and IIS 10. The required mapping for each feature has been listed below.
WebViewer control |
ActiveReports 14 Cache Item Script Mapping is required |
Compiled Report Handler (the report explorer is embedded in the assembly after compiling the report ) |
ActiveReport Script Mapping is required |
RPX HTTP Handler (when the *.rpx report is placed on the Web) |
ActiveReports 14 RPX Script Mapping is required |
RDLX HTTP Handler (when the *.rdlx report is placed on the Web) |
ActiveReports 14 RDLX Script Mapping is required |
- ParameterReport.aspx: The web form that demonstrates how to generate a report by passing a parameter to the report. This sample uses the Params report from the RpxReports folder of this Sample project. The date list is created by changing the SQL query of the report at run time. In this sample, when the date is selected from the Calendar control, the SQL query is updated and the report is generated. The report is generated dynamically in the SelectedIndexChanged event of the Calendar control. On this form, you can select the Viewer to display the report - HTMLViewer, AcrobatReader, or RawHTML.
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples directory.
- Web.config: The configuration file that contains the httpHandlers that allow ActiveReports to process reports on the Web.
Note: You need to manually update version information here when you update your version of ActiveReports.
- WebControl.aspx: This page is opened by clicking WebControl for ASP.NET on the Default.aspx page. By default, it displays the WebViewer control with the Invoice report. In this page, you can select from HTMLViewer, AcrobatReader, RawHtml viewer types and can also select from Page, Section and RDL report types to be displayed.
See Also