With ASP.NET, you can set up a Web Service that returns a dataset to use in ActiveReports. This walkthrough illustrates how to create one.
This walkthrough is split into the following activities:
To create an ASP.NET Web Service project
To create the Web Method
In the WebService, replace the existing <WebMethod()> _ and HelloWorld function with code like the following.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste OVER the existing WebMethod. |
Copy Code
|
---|---|
Private connString As String <WebMethod(Description:="Returns a DataSet containing all Products")> _ Public Function GetProduct() As Data.DataSet connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Users\[User Name]\Documents\GrapeCity Samples\ActiveReports 10\Data\nwind.mdb" Dim adapter As New Data.OleDb.OleDbDataAdapter("select * from products", connString) Dim ds As New Data.DataSet() adapter.Fill(ds, "Products") Return ds End Function |
To write the code in C#
C# code. Paste OVER the existing WebMethod. |
Copy Code
|
---|---|
private static string connString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:\\Users\\[User Name]\\Documents\\GrapeCity Samples\\ActiveReports 10\\Data\\nwind.mdb"; [WebMethod(Description="Returns a DataSet containing all Products")] public Data.DataSet GetProduct() { System.Data.OleDb.OleDbDataAdapter adapter; |
To test the Web Service
To publish the Web Service
To check the configuration in IIS
For information on consuming the DataSet Web Service in an ActiveReport, see DataSet Windows Application.