ActiveReports Developer 7
Professional Web Sample
See Also Support Forum
ActiveReports Developer 7 > ActiveReports Developer Guide > Samples and Walkthroughs > Samples > Professional > Professional Web Sample

Glossary Item Box

The Professional Web Sample describes the standard ActiveReports Developer web features as well as other features available in the Professional Edition only, such as HTTP handlers, Flash Viewer options, parameterized reports and more.


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.

ShowSample Location

ShowVisual Basic.NET

<User Folder>\ComponentOne Samples\ActiveReports Developer 7\Professional\VB.NET\ActiveReports7WebPro

ShowC#

<User Folder>\ComponentOne Samples\ActiveReports Developer 7\Professional\C#\ActiveReports7WebPro

ShowRuntime Features

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.

ShowWebControl for ASP.NET

This link opens the WebControl.aspx page that displays the Invoice report and allows you to select any of the four Viewer types - HTMLViewer, FlashViewer, PDF Reader and RawHTML.

ShowFlash Viewer Control

This link opens the FlashViewerIntro.aspx page where you can adjust settings, select a report and then click the "View Report" button to be redirected to a WebForm with the Flash Viewer.

ShowHTTPHandlers

This link opens the HttpHandlers.aspx page with the http handler examples.

ShowCustom Exporting PDF Example

This link opens the Invoice report in the PDF Reader by exporting it to memory stream and then outputting it in the browser.

ShowCustom Exporting HTML Example

This link opens the NWindLabels report. This report is outputted to the ReportOutput folder by using the MyCustomHtmlOutputter class and the exported HTML is displayed in the browser.

ShowParameterized Report Example

This link opens the page that demonstrates how to generate a report by passing a parameter to the report.

Note: To run this sample, you must have access to the Nwind.mdb. A copy is located at [User Documents folder]\ComponentOne Samples\ActiveReports Developer 7\Data\NWIND.mdb. If you are unable to access the data files in the sample, create the Data folder and place all the data files to this folder, or change the reference path to the data files within the folder according to your environment.

ShowProject Details

ShowCodeReports

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.

Showimages

The images folder contains the logo.png. This image file is used in the header of the FlashViewerIntro.aspx page.

ShowRdlxReports

The RdlxReports folder contains the PurchaseReport report. This report is used to demonstrate how the RPX and RDLX HttpHandlers function. For more details, see HttpHandlers.aspx below.

ShowRpxReports

The RpxReports folder contains the following reports - Invoice, InvoiceFiltered, NwindLabels, NwindLabelsFiltered and Params.

The Invoice.rpx report is used to demonstrate the Web Viewer 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.

All reports from this folder are used to demonstrate the Flash Viewer options. You can select one of these reports from the list on the FlashViewer.aspx page.

ShowThemes

The Themes folder contains themes to use on the Flash Viewer. Following themes can be used for the Flash Viewer. 

  • FluorescentBlue.swf
  • Office.swf
  • OliveGreen.swf
  • Orange.swf
  • VistaAero.swf
  • WindowsClassic.swf
  • XP.swf

ShowActiveReports.ReportService.asmx

The report web service is required for proper functioning of the Web Viewer. The ActiveReports.ReportService.asmx is added automatically to the project when you place the WebViewer control on the form. You can also add this service by using Add New Item in the Visual Studio 2010 Project menu.

For the information on how to use the WebViewer control, see Getting Started with the Web Viewer.

ShowCustomExportHtml.aspx

This Web form is displayed by clicking the Custom Exporting HTML Example option on the Default.aspx page.

In CustomExportHtml.aspx, the NWindLabels report is outputted to the ReportOutput folder using the CustomHtmlOutput class and the exported HTML is displayed in the browser.

Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples directory.

ShowCustomExportPdf.aspx

This Web form is displayed by clicking the Custom Exporting PDF Example option on the Default.aspx page. In CustomExportPdf.aspx, the Invoice report is exported to memory stream and then outputted in the browser.

Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples directory.

ShowCustomHtmlOutput class

This class is used for exporting a report to the HTML format. The CustomHtmlOutput class implements the required IOutputHtml in the HTML export and saves the output results to a file with a unique name.

ShowDefault.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)
  • FlashViewer Control (FlashViewerIntro.aspx) 
  • HTTPHandlers (HttpHandlers.aspx) 
  • Custom Exporting PDF Example (Invoice report) 
  • Custom Exporting HTML Example (NWindLabels report)
  • Parameterized Report Example(ParameterReport.aspx)

ShowFlashViewer.aspx

This is a web form with the Web Viewer that is displayed after you click the View Report button on the ActiveReports7 Flash WebViewer Sample.

In the Properties window, notice that the ViewerType property is set to FlashViewer, and the Height and Width properties are set to 100%. (This ensures that the viewer resizes to fill the browser window.) 

For information on the Flash Viewer, see Using the Flash Viewer.

ShowFlashViewerIntro.aspx

This web form displays the introductory text for the ActiveReports 7 Flash WebViewer Sample. On this page, you can adjust the Flash Viewer settings, select a language, a theme and a report for the Flash Viewer from the drop-down lists. The report is opened in the Flash Viewer by clicking the View Report button that you see on this page.
This sample uses the reports from the RpxReports folder of the Sample project.
Right-click the file and select View Code to see the code used to populate the Themes drop-down list and to redirect to the FlashViewer form.  

ShowGrapecity.ActiveReports.Flash.v7.Resources.swf

This file is used for localization and is necessary only if you want to use a language resource that is different from the default one. The default locale is U.S. English (en_US).

This file is located in the ...\ComponentOne\ActiveReports Developer 7\Deployment\Flash folder.

ShowGrapecity.ActiveReports.Flash.v7.swf

This file is required for using the Flash Viewer and is located in the ...\ComponentOne\ActiveReports Developer 7\Deployment\Flash folder.

ShowHttpHandlers.aspx

ActiveReports Developer 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 Developer 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 Developer 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 Developer 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 ActiveReport Developer 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 6.x and Configure HttpHandlers in IIS 7.x. The required mapping for each feature has been listed below.

WebViewer control ActiveReports 7 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)
ActiveReport 7 RPX Script Mapping is required

ShowParameterReport.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 runtime. 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 - HTML, Flash, AcrobatReader, or RawHTML.
Note: This sample requires write permissions to the ReportOutput folder that is located in the web samples directory.

ShowWeb.config

The configuration file that contains the httpHandlers that allow ActiveReports Developer to process reports on the Web.

Note that you need to manually update version information here when you update your version of ActiveReports Developer.

ShowWebControl.aspx

This page is opened by clicking WebControl for ASP.NET on the Default.aspx page. It displays the Web Viewer control with the Invoice report.
Using the WebViewer control, you can display the Invoice report on the WebViewerControl Sample page in the following web viewer types - HTMLViewer, FlashViewer, AcrobatReader, RawHtml
The Invoice report is specified in the ReportName property of the WebViewer control on the Design page of WebControl.aspx.

See Also

©2014. ComponentOne, a division of GrapeCity. All rights reserved.