ActiveReports 6 Online Help
Viewing Reports
Send comments on this topic.
ActiveReports 6 > ActiveReports User Guide > Getting Started > Viewing Reports

Glossary Item Box

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

  1. From the Visual Studio toolbox, drag the ActiveReports Viewer control onto your Windows form.
  2. Set the viewer's Dock property to Fill.
  3. Double-click the title bar of the Windows Form to create an event-handling method for the form Load event.
  4. 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.

ShowTo 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

ShowTo 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.