How to Dynamically Change the Report Direction Using Parameters in Bold Reports
To dynamically control the layout direction of a report in Bold Reports, you can use report parameters. This approach allows you to dynamically switch the Direction property of selected report items between Left-to-Right (LTR) and Right-to-Left (RTL) at runtime. This is useful for multilingual and localization scenarios where text needs to be displayed according to the reading direction of a language.
This guide explains how to configure and apply a parameter to dynamically set the report direction.
Applies To
- Bold Reports Designer
- Bold Reports Embedded Reporting
- RDL Reports
Steps to Change the Report Direction Dynamically
1. Create a Parameter for Language Direction
- Open the report in the Bold Reports Designer and navigate to the Parameters pane on the right side of the designer.
- Create a new parameter named
LanguageDirectionto control the report direction. - Set the Name property to
LanguageDirection. - Set the Prompt property to
Select Language Direction.
2. Assign Parameter Values
- Click Assign Value.
- Under the Available Values section, select Specify.
- Add the following values:
LTR(Left-to-Right)RTL(Right-to-Left)
The Direction property accepts the values LTR (Left-to-Right) and RTL (Right-to-Left). Ensure the parameter returns one of these exact values.
3.Apply the Parameter to Selected Report Items
- Select the specific cell or cells where you want the text direction to change. The Direction property is applied only to the selected report items and does not affect the entire report layout.
- Under the Localization category, locate the Direction property.
- Click the expression icon next to the Direction property and select Expression.
- Enter the following expression:
=Parameters!LanguageDirection.Value
4. Save and Preview the Report
- Click the Preview button in the top toolbar to preview the report.
When the Direction Is Set to LTR
When the Direction Is Set to RTL
Download the sample report here.
Conclusion
By using a report parameter, you can dynamically switch the Direction property of selected report items between LTR and RTL based on user selection. This provides greater flexibility when designing multilingual reports without modifying the report design.