ActiveReports makes it easy for you to preview your report while you are still creating it. Just click the Preview tab at the bottom of the ActiveReport designer. In this way you can see and work with the report without the need to run the project.
In this example, the report is named rptMain. If you copy and paste the code below, replace rptMain with the name of your report.
To display report output in the Viewer control
The following examples show 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 rpt As New rptMain() rpt.Run() Viewer1.Document = rpt.Document |
To write the code in C#
C# code. Paste INSIDE the Form Load event. |
Copy Code |
---|---|
rptMain rpt = new rptMain(); rpt.Run(); this.viewer1.Document = rpt.Document; |
Note: To enable the viewer's Copy button, add references to the RtfExport and TextExport DLLs. |