I. Description
When previewing the template, hoping that the report name can be displayed dynamically instead of being fixed. At this time, you can define parameters in the report title and assign different values to the parameters to change the report title. The implementation process is described in detail below.
II. Ideas
It can be achieved by writing a parameter in Template>Web Attributes>Basic>Title, and then assigning a value to the parameter or directly by JS.
Note: If the report is integrated into a Web page or embedded in other pages, the following method of modifying the title does not apply.
III. Example1
1. Open the template
Open the tempalte: %FR_HOME%\webroot\WEB-INF\reportlets\GettingStartedEN.cpt
2. Set the parameter
Select Template>Web Attributes>Basic>Title in the toolbar, and write a parameter such as ${mytitle} in the toolbar, as shown in the following figure:
3. Effect preview
Click Pagination Preview, add &mytitle=areasales after the url, you will find that the name of the report has been modified to areasales, as shown in the figure below:
IV. Example2
1. Open the template
Open the template: %FR_HOME%\webroot\WEB-INF\reportlets\GettingStartedEN.cpt
2. Add loading end event
Click Template>Web Attributes>Data Entry Settings, select Individually set for the template, and add Loading End event, as shown in the following figure:
The JS code is as follows:
3. Effect preview
Save the template, click Data Entry Preview, the effect is shown in the figure below:
V. Example3
Example of setting the title of a dashboard.
Please refer to the completed template for details of designing report.
1. Add post-initialization event
Select body for the current widget, and add After Initializational event, as shown in the following figure:
The JS code is shown below:
2. Effect preview
Effect as shown below: