I. Description
Click on the value of the hyperlink and transfer it directly to the chart. Only part of the chart is refreshed, instead of refreshing the entire page.
II. Principle
The data in the report is transferred to the chart through the hyperlink chart hyperlink-linkage floating element method, or the data in the report is transferred to the data set of the chart through the hyperlink-dynamic parameter method, so as to realize the linkage between the report and the chart.
III. Example
1. Open the template
Take the report %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\Chart\Floating_Chart.cpt as an example, and design the report and chart linkage on this basis.
2. Chart dataset
1) Define the chart dataset ds2
Get the value of the region selected by the hyperlink, query the sales volume of the salesperson in the region, SQL statement:
SELECT * FROM Sales_Volume where 1=1
${if(len(Region) == 0,"","and Region = '" + Region + "'")}
2) Modify the chart dataset
Select the chart, select the chart attribute table-data in the chart attribute table, select the dataset ds2, Category: Salesperson, use the selected FieldName as the legend item (series) name for the series name, and select the Sales_Volume for the FieldName.
3. Hyperlink settings
Click A2 cell, right click to select Hyperlink, click "+", select Chart Hyperlink-Floating Element, set as follows:
Method 1: Realize linkage through the hyperlink>chart hyperlink-floating element method
Add Chart Hyperlink-Floating Element1, select Float Element, add parameter Region, value selection formula input: $$$, as shown below:
If the dataset of the chart is a cell dataset, add the chart hyperlink-link cell.
Note: When selecting floating elements in the drop-down box, if there are too many floating elements in the template, you need to know the names of the floating elements. You can right-click the floating chart and choose to set the floating element name to customize the floating element name.
Method 2: Realize linkage through hyperlink-dynamic parameters
Add dynamic parameters, add parameter Region, value selection formula input: $$$, as shown below:
Note: The dynamic parameter is to transfer the parameter value directly to the dataset, and change the result of the chart dataset to realize the linkage between the report and the chart. Similarly, to realize the chart linkage report can also be realized by using dynamic parameters.
4. Save and preview
Save the template and click pagination preview to see the effect.
The completed template can refer to %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\ReportApplication\FeaturesApplication\Linkage_of_report_and_chart.cpt.