- 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, and 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 below steps to apply 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 Theme. Therefore, in case the Theme is changed - control view may also change if the control's Style uses values from Theme.
To Apply Theme to a Report
Follow the below steps to apply 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 or user context values, or the parameter values. Refer Using Expressions in Report Themes below for more details.
To preview the report with, 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
In a multi-tenant deployment, a user can dynamically change the document theme based on the user context.
Example: When a user in Tenant A runs the report, the theme should be set based on a user context value for that user/tenant, where the theme property of the report is an expression which can have organization/user context and parameter values. Whereas, when a different user in Tenant B runs the same report, the theme should be different based on that user's user context value.
So, a report will have an expression theme value that will be evaluated differently for different report parameter values or users/organizations, etc. This allows more customized reports catered towards different tenants in a multi-tenant deployment.
Steps to add an expression
Log in to the Wyn application.( In this example we have taken an admin user with a username as admin).
From the Documents section, select a report and click More. Then click Edit this report option. In this example, we are taking the Employee Sales Summary report.
Report Designer is displayed.
Select the report and click the Properties tab.
Under the Layout section, click the Add Item against the Themes property.
Click the Data Binding option. A list is displayed.
Select the Expression option from the list.
Layout-Themes Expression Editor is displayed.
Enter the expression as per the user context. In this example, for the username admin, we have taken the theme as Warm and Active and the expression for this will be written as:
{IIF(UserContext.GetValue("name") = "admin", "Warm", "Active")}
Click the Save button.
Now save the report and preview it.
The report theme that was set using the expression will be applied.
Now, let us log in to the Wyn application as another user say User1, who is not an Admin and follow the same steps as above from 2 to 6.
Enter the expression as per the user context. In this example, for the username User1, we have taken the theme as Coral and Crisp and the expression for this will be written as:
{IIF(UserContext.GetValue("name") = "User1", "Coral", "Crisp")}
Click the Save button.
Now save the report and preview it.
The report theme that was set using the expression will be applied.
So, for the same report, different users ( admin and User1) have different themes.