ActiveReports 14 .NET Edition
ActiveReports 14 User Guide / Concepts / Page Report/RDL Report Concepts / Report Appearance / Themes
In This Topic
    Themes
    In This Topic

    A theme is a collection of properties that defines the appearance of a report. A theme includes colors, fonts, images, and constant expressions that you can apply to report elements once you add a theme to a report.

    You can add one or many themes to a report. If a report has multiple themes, you can use the report's GrapeCity.ActiveReports.PageReportModel.CollateBy enumeration to control the page order in a report. See Set Up Collation for more information.

    The Theme Editor and the Report - Themes dialog allow you to manage themes in a report.

    In the Theme Editor, you can create a new theme by setting colors, fonts, images, and use constant expressions in a theme and then saving a new theme as an .rdlx-theme file on your local machine. Then you can add this theme to your report in the Report – Themes dialog. Also, in the File menu, select Open to open and modify an existing theme and select Save or Save As to save the changes on your local machine.

    Theme Editor

    Theme Editor

    To access the Theme Editor

    From the Start menu, go to All Programs > GrapeCity > ActiveReports and select ActiveReports Theme Editor.

    The Report – Themes dialog displays the report's themes. This dialog allows you to create a new theme, add, modify or remove an existing one, as well as rearrange the order of themes if a report has many themes. When you select to create or modify a theme, the Theme Editor is opened.

    Report - Themes dialog

    Report - Themes dialog

    To access the Theme - Report dialog

    1. In the Designer, click the gray area around the report page to select a report.
    2. Do one of the following:
      • In the Properties window, select the Themes property and click the ellipsis (…) button to open the Report - Themes dialog.
      • With the report selected, in the Properties window under properties where the commands are displayed, click the Property dialog link. In the Report dialog that appears, go to Themes. See Properties Window for further information on commands.
      • On the Report menu, select Report Properties and go to Themes in the Report dialog that appears.

    Create and add themes

    A theme is a collection of properties that defines the appearance of a report. A theme includes colors, fonts, images, and expressions that you can apply to report elements once you add a theme to a report.

    You can add one or many themes to a report. If a report has multiple themes, you can use the report's GrapeCity.ActiveReports.PageReportModel.Report.CollateBy property to control the page order in a report.

    Use the following instructions to create and add themes.

    To create a new theme

    1. From the Start menu, go to All Programs > GrapeCity > ActiveReports and select ActiveReports Theme Editor.
    2. In the Theme Editor that opens, define the colors, fonts, images, and constant expressions properties for your new theme under the corresponding tabs.
    3. On the File menu, select Save.
    4. Choose a directory on your local machine and enter the name of a new theme, then click Save.

    To add a theme to the report 

    1. In the Designer, click the gray area around the report page to select a report.
    2. In the Properties window, select the Themes property and click the ellipsis (…) button to open the Report - Themes dialog.
    3. In the Report - Themes dialog that opens, click the Open... icon above the list of themes.
    4. In the Open dialog that appears, select a theme file from your local files and click Open.

    Customize and apply themes

    Use the following instructions to customize an existing theme and apply it to your report.

    To modify a theme

    1. In the Designer, click the gray area around the report page to select a report.
    2. In the Properties window, select the Themes property and click the ellipsis (…) button to open the Report - Themes dialog.
    3. In the Report - Themes dialog that opens, select an existing report theme.
    4. Click the Edit... icon above the list of themes.
    5. In the Theme Editor that opens, modify the theme properties and click OK to close the dialog.

    To apply a theme color

    1. In the Designer, select the report’s control (for example, a TextBox).
    2. In the Properties window, go to the color-related property (for example, the BackgroundColor property) and click the arrow to display the drop-down list of values.
    3. In the list that appears, go to the Theme tab and select the color you want.
      Setting color in the Theme tab of Properties window

      Setting color in the Theme tab of Properties window

    To apply a theme font

    1. In the Designer, select the report’s control (for example, a TextBox).
    2. In the Properties window, go to a property from the Font properties group (for example, the Font property) and click the arrow to display the drop-down list of values.
    3. In the values list that appears, select a font defined in a theme (for example, =Theme.Fonts!MinorFont.Family).

    Use Constant Expressions in a theme

    In the Theme Editor, you can define constant expressions to be used in a theme. Later, you can apply a constant expression to the report’s control by selecting it in the Value field of that control.

    Also, you can apply a constant expression to a report’s control in code by using the following syntax (VB code example):

    =Theme.Constants!Header
    =Theme.Constants("Header")

    Constant expressions allow you to define a name and an associated value to be used in themes.

    Use the following instructions to create and use constant expressions in themes.

    To define a constant expression

    1. In the Theme Editor, go to Constants.
    2. Double-click the field under Name and enter the Constant name (for example, Header).
    3. In the next field to the right, under Value, enter the Constant value (for example, Invoice#).

    To use a constant expression

    1. In the Designer, select the report’s control (for example, a TextBox).
    2. In the Properties Window, go to the Values field and select the <Expression> option from the drop-down list to open the Expression Editor.
    3. In the Expression Editor, expand the Themes node with the constant expressions defined in the report theme.
    4. In the Themes node, select a constant and then click the Replace or Insert button.
    5. Click OK to add the constant expression in the TextBox. 

      Adding expression in Expression Editor

      Adding expression in Expression Editor



    Set Up Collation

    You can add multiple themes to a report. In this case, the report renders a combination of multiple outputs for each theme. For example, if a report has two themes, then the report output includes a combination of the first and the second themes, applied to each report page. You can control the combination rules of the report output in the GrapeCity.ActiveReports.PageReportModel.Report.CollateBy property.

    Caution: If you are using collation in a report, you cannot use interactive features, such as drill down, links, document map, and sorting.

    You can control the page order of a rendered report with multiple themes by selecting the collation mode in the CollateBy property of the report:

    Note: The collection of constant expressions must be the same in all themes of a report. See Use Constant Expressions in a Theme for further information.
    1. In the Designer, click the gray area around the report page to select the report.
    2. In the Properties Window, go to the CollateBy property and select one of the available options:
      • Simple. Renders report pages without any specific sorting. For example, if you have a report with 2 themes, the report renders all pages with theme 1, then all pages with theme 2.

        Simple Collation Mode

        Simple Collation Mode



      • ValueIndex. Sorts report pages by page number. For example, if you have a report with 2 themes, the report renders page 1 for theme 1 and 2, then page 2 for theme 1 and 2, and so on.

        ValueIndex Collation Mode

        ValueIndex Collation Mode



      • Value. Sorts report pages by the grouping expression that you specify in the report's FixedPage dialog. For example, if you have a report with 2 themes with grouping, the report renders group1 (pages 1 and 2 of theme1, then pages 1 and 2 of theme2), then group 2 (pages 1 and 2 of theme1, then pages 1 and 2 of theme2), and so on.

        Value Collation Mode

        Value Collation Mode



        Note: In RDL Reports, the Value collation mode is not available by design.

    See Add Page Numbers for information on setting cumulative page count formats for Page Report.