Overview
Application Scenario
The value of the dynamic parameter can change dynamically. After you click a hyperlink, the display effect of the report can be altered based on the changed parameter values.
The most common application is to achieve sorting effects, as shown in the following figure.
Function Description
The simple configuration page allows you to just add parameters and their values to achieve the function.
Dynamic parameters can be used with the dataset parameters and the template parameters in the report.
For details about hyperlink parameter passing, see Hyperlink Parameter Passing.
A dynamic parameter refresh will trigger a global refresh.
Example
An order table will be created in this example. You can click the field Order Date in this table to select whether the value is sorted in ascending or descending order.
Template Preparation
1. Create a general report, create a dataset named ds1, and enter the SQL statement: SELECT * FROM Orders ORDER BY "Order Date" ${a}.
ORDER BY is used in the SQL statement for order date sorting. However, the sorting method is set as a parameter, by which you can select the ascending or descending order when clicking the hyperlink.
The dynamic parameter of the hyperlink can be used with the dataset parameter for date sorting.
2. Design a table according to the style shown in the following figure.
You need to click cell C2, set Format to Date, and select yyyy-MM-dd on the right Cell Element panel.
You need to click cell D2, set Format to Date, and select #0.00 on the right Cell Element panel.
Hyperlink Addition
1. Click cell C1, add a hyperlink of a dynamic parameter, rename the added hyperlink Dynamic Parameter1-Ascending Order Sorting, add a parameter a, and set the parameter value to ASC.
2. Add another hyperlink of a dynamic parameter for cell C1, rename the added hyperlink Dynamic Parameter2-Descending Order Sorting, add a parameter a, and set the parameter value to DESC.
Effect Display
Save the template and click Pagination Preview. The effect is shown in section "Application Scenario."
The template can be previewed on App (DataAnalysis) and HTML5 terminals.
Template Download
You can download the template: Achieving Sorting via Dynamic Parameter Hyperlink.cpt.