ActiveReports 18 .NET Edition
Samples / Samples / API / Section Report / Style Sheets
In This Topic
    Style Sheets
    In This Topic

    This sample demonstrates how you can change styles at run time to provide a different look to a same report. The project includes two reports, three report styles and a form containing the ActiveReports Viewer control and other controls that allow you to select any combination of styles and reports.

    Style Sheets

    Sample Location

    Visual Basic.NET

    https://github.com/activereports/Samples18/tree/main/API/Section/Stylesheets/VB.NET

    C#

    https://github.com/activereports/Samples18/tree/main/API/Section/Stylesheets/C#

    Details

    Choose Report
    Choose between the type of report, Categories and Product List, you want to display in the Viewer control.

    Choose Style
    Choose between Classic, Colored and External style sheet options to apply the style to the selected report.
    Clicking the Choose button option for External style sheet displays the Open dialog that shows only *.reportstyle files, and passes the selected reportstyle path and file name string to the externalStyleSheet variable.

    Run Report button
    Click this button to display the selected report with the applied style in a Viewer control. Clicking this button creates an SectionReport object, assigns the selected report to it, and assigns a path and file name string to the styleSheet variable. It then assigns the style sheet to the report using the LoadStyles(styleSheet) method, runs the report, and displays it in the viewer.

    The sample consists of: