The ActiveReports WinForms Viewer and WPF Viewer let you print, and export reports that are hosted on ActiveReports Server. You can view reports in both the Viewers from the File menu using the Open from server command, or through code by invoking the ViewerExtension.LoadDocument method.
You can also view a specific report revision from ActiveReports Server. See Report Versions, for more information.
The following code example demonstrates how you can view reports that are hosted on ActiveReports Server in the Windows Forms Viewer or WPF Viewer.
Visual Basic.NET code. Paste at beginning of code view. |
Copy Code
|
---|---|
Imports GrapeCity.ActiveReports.ArsClient
|
Visual Basic. NET code. Paste INSIDE Form_Load event. |
Copy Code
|
---|---|
Dim serverReport As New RemoteReportDescriptor() ' Specify the Server URL and Credentials serverReport.ReportServerUrl = "http://1.0.0.0:8080/" serverReport.UserName = "admin_user" serverReport.Password = "password@123" ' Specify the Report Name serverReport.ReportName = "Customer List" serverReport.RevisionNumber = 1 Viewer1.LoadDocument(serverReport) |
C# code. Paste at beginning of code view. |
Copy Code
|
---|---|
using GrapeCity.ActiveReports.ArsClient;
|
C# code. Paste INSIDE Form_Load event. |
Copy Code
|
---|---|
RemoteReportDescriptor serverReport = new RemoteReportDescriptor(); // Specify the Server URL and Credentials serverReport.ReportServerUrl = "http://1.0.0.0:8080/"; serverReport.UserName = "admin_user"; serverReport.Password = "password@123"; // Specify the Report Name serverReport.ReportName = "Customer List"; serverReport.RevisionNumber = 1; viewer1.LoadDocument(serverReport); |