ActiveReports 6 Online Help
DataSet Web Service
Show AllShow All
Hide AllHide All

With ASP.NET, you can set up a Web Service that returns a dataset to use for an ActiveReport. This walkthrough illustrates how to create one.

This walkthrough 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\GrapeCity\ActiveReports 6\Data\NWIND.MDB (on a 64-bit Windows operating system, a copy is located in C:\Program Files (x86)\GrapeCity\ActiveReports 6\Data\NWIND.MDB).

To create an ASP.NET Web Service project

  1. From the File menu, select New, then Web Site.
  2. In the New Web Site dialog that appears, select ASP.NET Web Service.
  3. Change the name of the project.
  4. Click OK to open the new project in Visual Studio.

To create the Web Method

In the App_Code/Service.vb or Service.cs file that displays by default, replace the existing <WebMethod()> _ and HelloWorld function with code like the following.

To write the code in Visual Basic.NET

To write the code in C#

To test the Web Service

  1. Press F5 to run the project.
  2. If the Debugging Not Enabled dialog appears, select the option that enables debugging and click OK to continue.
  3. In the list of supported operations, click the GetProduct link. (The description string from the code above appears below the link.)
  4. Click the Invoke button to test the Web Service operation.
  5. If the test is successful, a valid XML schema of the Northwind products table displays in a new browser window.
  6. Copy the URL from the browser for use in the Web Reference of your DataSet Windows Application.

To publish the Web Service

  1. In the Solution Explorer, right-click the project name and select Publish Web Site.
  2. In the Publish Web Site window that appears, click the OK button.
  3. This makes the Web Service available for consumption by other projects in a folder under the main folder called PrecompiledWeb.

To create a virtual directory in Internet Information Services

  1. In Windows Explorer, navigate to the folder containing your Web service folder.
  2. Right-click the folder and select Sharing and Security.
  3. On the Web Sharing tab, select the Share this folder radio button.
  4. Click the OK button to save the setting and close the window.

To create a virtual directory in IIS 7.x

  1. In the Control Panel, open Administrative Tools, then Internet Information Services Manager.
  2. In the Internet Information Services Manager window that appears, expand the tree view in the left pane until you see the Web Site you need to create a virtual directory for.
  3. Right-click the node for the Web Site and select Add Application…
  4. In the Add Application dialog box that appears, enter the following information:

    Alias: enter a name for the virtual directory.

    Physical path: select the folder that contains your Web service folder.

  5. Click the OK button to save the settings and close the window.
Important: In order to consume Web services in your Windows applications, you must set permissions to allow the ASP.NET user to consume the services. Ask your server administrator for help with this.

For information on consuming the DataSet Web Service in an ActiveReport, see DataSet Windows Application.

See Also

How To

Getting Started