In ActiveReports, you can use a Web Service that returns the content of a Section report to show in the Windows Forms viewer control.
This walkthrough illustrates how to create a Windows client application that returns the content of a Section report in the Windows Forms viewer.
This walkthrough builds on the Document Web Service walkthrough and is split up into the following activities:
To create a Visual Studio project
To add the Viewer control
To add a web reference
To add a reference to a web service in Visual Studio that is compatible with the .NET Framework Web service version
To add a reference to a web service in Visual Studio
To display the content returned by the Document Web Service in the viewer
To display the report content
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Form Load event. |
Copy Code
|
---|---|
Dim ws As New localhost.Service Me.Viewer1.Document.Content = ws.GetProductsReport() |
To write the code in C#
C# code. Paste INSIDE the Form Load event. |
Copy Code
|
---|---|
localhost.Service ws = new localhost.Service(); this.viewer1.Document.Content = ws.GetProductsReport(); |
To display the report content
The following example shows what the code for the method looks like.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Form Load event. |
Copy Code
|
---|---|
Dim ws As New ServiceReference1.ServiceSoapClient() |
To write the code in C#
C# code. Paste INSIDE the Form Load event. |
Copy Code
|
---|---|
ServiceReference1.ServiceSoapClient ws = new ServiceReference1.ServiceSoapClient(); |
To update the app.config file
To run the project
Press F5 to run the project.