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
- In the Theme Editor, go to Constants.
- Double-click the field under Name and enter the Constant name (for example, Header).
- In the next field to the right, under Value, enter the Constant value (for example, Invoice#).
- In the Designer, select the report’s control (for example, a TextBox).
- In the Properties Window, go to the Values field and select the <Expression> option from the drop-down list to open the Expression Editor.
- In the Expression Editor, expand the Themes node with the constant expressions defined in the report theme.
- In the Themes node, select a constant and then click the Replace or Insert button.
- Click OK to add the constant expression in the TextBox.