Glossary Item Box

ASP.NET Web Sample | Samples | Walkthroughs | OutputFormat Strings | GroupKeepTogether enumeration

Tasks: Visual Studio.NET 2005 Web Changes | Adding ActiveReports Controls to the Visual Studio Toolbox | Manually Configuring Web Samples

See Also ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

Walkthrough: Web Viewer Control

The ActiveReports WebViewer control allows you to easily publish simple reports to the web for viewing in the browser. The client machine will not require ActiveReports or ASP.NET to be installed. The WebViewer also takes advantage of a report queueing technology to ensure the reports are executed and outputted efficiently. To use the WebViewer you will select an ActiveReport using the Report property of the WebViewer in the property list and set the ViewerType property to the viewer of your choice. Alternatively, you can set the Report property programmatically to a new instance of an ActiveReport class.

This walkthrough is split up into the following activities:

To complete the walkthrough, you must have access to the NorthWind database (NWind.mdb). You must also have access to Internet Information Services either from your computer or from the server. You must also run the "Configure Web Sample" option from the Data Dynamics ActiveReports for .NET 2.0 program menu from your Windows Start button.

When you have completed this walkthrough, you will have a report that looks similar to the following.

Adding an ActiveReport to an ASP.NET Web application

Important: If you are using Visual Studio.NET 2005, please see the Visual Studio.NET 2005 Web Changes topic.

To add an ActiveReport to your project

  1. Open a new ASP.NET Web application in Visual Studio.
  2. Click on Project > Add New Item.
  3. Select ActiveReports file and rename the file rptWebView.
  4. Click Open.

Connecting the report to a data source

To connect the report to a data source

  1. Click on the yellow report DataSource icon in the Detail section. This brings up the report DataSource dialog box.
  2. Click on Build...
  3. Select Microsoft Jet 4.0 OLE DB Provider and click Next >>.
  4. Click on the ellipsis to browse for the access path to NWind.mdb. Click Open once you have selected the appropriate access path.
  5. Click OK to continue.
  6. In the Query field, type "Select * from products ORDER BY categoryID, productname".
  7. Click OK to return to the report design surface.

Adding controls to the report to contain data

To add controls to the report

  1. Add a GroupHeader/Footer section to rptWebView.
  2. Make the following changes to the group header:
    • Change the name to ghProducts
    • Change the DataField property to CategoryID
    • Change the GroupKeepTogether property to FirstDetail
    • Change the KeepTogether property to True
  3. Add the following controls to the GroupHeader section:

    Control Name Text/Caption Location
    Label lblProductName Product Name 0, 0
    Label lblQuantityPerUnit Quantity Per Unit 1.1875, 0
    Label lblInStock In Stock 2.5625, 0
    Label lblUnitPrice Unit Price 4, 0

  4. Add the following controls to the Detail section:

    Control DataField Name Text/Caption Location OutputFormat
    TextBox ProductName txtProductName Product Name 0, 0 (Empty string)
    TextBox QuantityPerUnit txtQuantityPerUnit Quantity Per Unit 1.1875, 0 (Empty string)
    TextBox UnitsInStock txtInStock Units In Stock 2.5625, 0 (Empty string)
     
    TextBox UnitPrice txtUnitPrice Unit Price 4, 0 Currency

Adding the ActiveReports WebViewer control to the Web Form

  1. Click on the ActiveReport WebViewer control in the appropriate toolbox and drag it onto WebForm1.
  2. Adjust the size according to your needs.
  3. Change the Report property to rptWebView.
  4. Make sure the ViewerType property is set to HtmlViewer.
Note   To view the report in PDF format, change the ViewerType property to AcrobatReader. To use the ActiveX Viewer, change the ViewerType property to ActiveXViewer and paste the ActiveX viewer .cab file in your project folder (for help with this, see " Using ActiveX Viewer Control on the Web").

ASP.NET Web Sample | Samples | Walkthroughs | OutputFormat Strings | GroupKeepTogether enumeration

Tasks: Visual Studio.NET 2005 Web Changes | Adding ActiveReports Controls to the Visual Studio Toolbox | Manually Configuring Web Samples

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.