Reports for WinForms | ComponentOne
In This Topic
    Previewing Reports
    In This Topic

    To preview the report, use the use the C1Report.Document property. Assign it to the Document property in the Reports for WinForms preview control or to the .NET PrintPreview or PrintPreviewDialog controls and the preview controls will display the report and allow the user to browse, zoom, or print it. For example:

    To write code in Visual Basic

    Visual Basic
    Copy Code
    ' Load report definition
    c1r.Load(reportFile, reportName)
     
    ' Preview the document
    c1preview1.Document = c1r
    

    To write code in C#

    C#
    Copy Code
    // Load report definition
    c1r.Load(reportFile, reportName);
     
    // Preview the document
    c1preview1.Document = c1r;
    
    Note: C1Report works with the .NET preview components, but it is optimized to work with the included Reports for WinForms preview controls. When used with the included controls, you can see each report page as it is generated. With the standard controls, you have to wait until the entire report is ready before the first page is displayed.