ActiveReports for .NET 3 Online Help Request technical support
DataSet Windows Application
See Also
User Guide > Samples and Walkthroughs > Walkthroughs > Standard Edition Walkthroughs > Advanced > Web Walkthroughs (Standard Edition) > Web Services Walkthroughs > DataSet Windows Application

Glossary Item Box

In ActiveReports for .NET 3.0, you can use a Web Service that returns a dataset as the data source for your reports.

This walkthrough illustrates how to create a Windows client application that uses the dataset Web Service as the data source for an ActiveReport.

This walkthrough builds on the dataset Web Service walkthrough and is split up into the following activities:

To complete the walkthrough, you must have access to the Northwind database.
A copy is located at C:\Program Files\Data Dynamics\ActiveReports for .NET 3.0\Data\NWIND.MDB.

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

Adding an ActiveReport to a Visual Studio project

To add an ActiveReport to a Visual Studio project

  1. Open a new project in Visual Studio.
  2. From the Project menu, select Add New Item.
  3. Select ActiveReports 3.0 File and rename the file rptProducts.
  4. Click Open (or Add in Visual Studio 2005).

Adding controls to display the data

To add controls to the reports

  1. Add the following controls to the Detail section of rptProducts, setting their properties as indicated:
    Control DataField Name Text Miscellaneous Location
    Textbox ProductName txtProductName Product Name Size = 2.9, 0.19 0, 0
    Textbox UnitPrice txtUnitPrice Unit Price OutputFormat = Currency 3, 0
  2. Set the CanShrink property of the Detail section to True.

Adding a web reference to the project

To add a web reference

  1. From the Project menu, select Add Web Reference.
  2. Type in the address of the .asmx file for the dataset Web Service you created in the previous walkthrough. You can get the address by running the project from the previous walkthrough and copying the url from the address in the browser. (It will look something like http://localhost:####/DataSetWS/Service.asmx where #### is the port number.) 
  3. Click the Go button, and then click the Add Reference button when the Web Service is recognized.

Adding the code needed to set the report's data source control equal to the dataset returned by DataSetWS

To write the code in Visual Studio 2003

To write the code in Visual Studio 2005

Viewing the report

To view the report

  1. Add the ActiveReports viewer control to a Windows Form.
  2. Add the code needed to set the viewer document equal to the report document. See Using the ActiveReports Windows Form Viewer for help.
You can quickly view your report at design time by clicking the Preview tab at the bottom of the designer.

See Also

©2009. All Rights Reserved.