- Getting Started
- Administration Guide
- User Guide
- Developer Guide
Styles and Themes
With styles, you can enhance the appearance of report controls such as tables and charts. With themes, you can enhance the overall appearance of your reports.
Let us enhance the appearance of the following report:
To Apply Style to a Table
Follow the steps below to apply a style to a table data region.
Select the Table data region.
Go to the LAYOUT - Style property in the Properties pane.
Select a style, say, Light Style 1 Accent 5, from the drop-down.
Preview the report.
Note: Style either uses constant values or values from a Theme. Therefore, if the Theme is changed, the control’s appearance may also change if the control's Style uses values from the Theme.
To Apply a Theme to a Report
Follow the steps below to apply a theme to a report.
Select Report from the ribbon menu at the top of the design area.
Click Switch Theme.
Select a theme, say, Cordial, or set the LAYOUT-Theme property of the report in the Properties pane. You can also pass expressions to display the report theme based on the organization, user context values, or parameter values. Refer to Using Expressions in Report Themes below for more details.
To preview the report, click the Preview button on the top-left side of your screen. Notice that all the text content, including No Data Content, inherits the font and color of the applied theme.
Using Expressions in Report Themes
You can change the document theme at runtime based on expressions.
Example 1: In a multi-tenant deployment, you can dynamically change the document theme using expressions. When a user in Tenant A runs the report, the theme is set based on a user context value for that user/tenant. The theme property of the report uses an expression that can include organization/user context and parameter values. When a different user in Tenant B runs the same report, the theme is different based on that user’s context value.
This allows a report to evaluate its theme expression differently for different users, organizations, or parameter values, enabling more customized reports across tenants.
Steps to Add an Expression
Log in to the Wyn application. (In this example, we use an admin user with the username admin.)
From the Documents section, select a report and click More > Edit this report. In this example, we are using the Employee Sales Summary report. The Report Designer is displayed.
Select the report and click the Properties tab.
Under the Layout section, click the Add Item
next to the Themes property.
Click the Data Binding option. A list is displayed.
Select the Expression option from the list. The Layout-Themes Expression Editor is displayed.
Enter the expression as per the user context. In this example, for the username admin, we use the themes Warm and Active. The expression is:
{IIF(UserContext.GetValue("name") = "admin", "Warm", "Active")}
Click the Save button.
Save and preview the report. The report theme set using the expression is applied.
Now, log in to the Wyn application as another user, say User1, who is not an admin, and repeat steps 2 to 6.
Enter the expression as per the user context. In this example, for User1, we use the themes Coral and Crisp. The expression is:
{IIF(UserContext.GetValue("name") = "User1", "Coral", "Crisp")}
Click the Save button.
Save and preview the report. The report theme set using the expression is applied.
For the same report, different users (admin and User1) see different themes.
Example 2: Changing Themes Through Parameter You can also change the theme using a parameter in the report. In this example, we add a parameter named Parameter1 with values Active and Warm, as described below:
Steps to Add an Expression
Log in to the Wyn application.
Bind to the dataset.
Add a parameter (Parameter1) and set its values. Click the Non-Queried option under Available Values and add values Warm and Active, as shown below.
Select the report and click the Properties tab.
Under the Layout section, click the Add Item next to the Themes property.
Select the Expression option from the list. The Layout-Themes Expression Editor is displayed.
Enter the expression using the parameter:
{@Parameter1}
Click the Save button.
Preview the report. The report theme will be set using the selected parameter value.
When Parameter1 is set to Active, the report theme is Active.
When Parameter1 is set to Warm, the report theme is Warm.