Previewing Reports at Design Time
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.

Using the ActiveReports Windows Form Viewer
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
- From the Visual Studio toolbox, drag the ActiveReports Viewer control onto your Windows form.
- Set the viewer's Dock property to Fill.
- Double-click the title bar of the Windows Form to create an event-handling method for the form Load event.
- Add code to the handler to run the report and display it in the viewer.
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 | |
| 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. |
Hide All