ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Win Assembly / GrapeCity.ActiveReports.Viewer.Win Namespace / Viewer Class / LoadDocument Method / LoadDocument(SectionReport) Method

The section report to view in the viewer.

Example

In This Topic
    LoadDocument(SectionReport) Method
    In This Topic
    Load the specified section report object during run-time.
    Syntax
    'Declaration
     
    Public Overloads Sub LoadDocument( _
       ByVal report As SectionReport _
    ) 
    public void LoadDocument( 
       SectionReport report
    )

    Parameters

    report

    The section report to view in the viewer.

    Remarks
    This method enables the Viewer to display the content of a GrapeCity.ActiveReports.SectionReport, which is a report designed using the Section-based approach. The GrapeCity.ActiveReports.SectionReport should be properly initialized with its layout definition and any necessary data connections or scripting logic. It's important to note that loading a new report will replace any previously loaded document or report in the Viewer.
    Example
    Here is an example of loading a GrapeCity.ActiveReports.SectionReport into the Viewer:
    // Assuming 'viewer' is an instance of the Viewer control and 'reportPath' is the path to the .rpx file
    var report = new SectionReport();
    report.LoadLayout(XmlReader.Create(reportPath));
    report.Document.Printer.PrinterName = string.Empty;
    viewer.LoadDocument(report);
    See Also