I. Overview
1. Application scenarios
Thousands of reports may be produced for each project. The user only wants to view one or a few of them, but there are thousands of them in front of the user. It is time-consuming and labor-intensive for the user to select and preview one by one. Now provide a method, users can easily choose to preview the report they want to view. As shown below:
2. Implementation ideas
Main template: Add a drop-down checkbox widgetl in the parameter panel, and pass the template URL to the webpage frame widget in the report through the drop-down checkbox. The webpage frame widget displays the template preview effect. If multiple templates are selected, the effect will be presented in multiple sheets.
Sub-template: modify the name of the sheet to be used.
II. Example
1. Sub-template preparation
Open %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\GroupReport\Group_Report.cpt , click "sheet", right-click and select "Rename", change the sheet name to the Salesperson sales table, As shown below:
Open %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm\LineForm1.cpt , click "sheet", right-click and select "Rename", change the sheet name to "Product details" ,As shown below:
2. Master template design
1) Data preparation
Create a new general report, create a new built-in data set report list , and store the path of the sub-template converted by encode. As shown below:
How to implement encode conversion in template path:
The path of Salesperson sales table: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\GroupReport\Group_Report.cpt
You only need to transcode {reportlet:'/doc-EN/Primary/GroupReport/Group_Report.cpt'} encode ,
The result after transcoding is: %7Breportlet%3A'%2Fdoc-EN%2FPrimary%2FGroupReport%2FGroup_Report.cpt'%7D
The path of the product list: %FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm\LineForm1.cpt
The result after transcoding is: %7Breportlet%3A'%2Fdoc-EN%2FForm%5CLineForm%5CLineForm.cpt'%7D%20
2) Add template parameters
Select "Template>Template Parameters", click "Template Parameters", and set the parameter name to report , as shown in the figure below:
3) Template design
Merge some cells, click "Widget Setting", select "Iframe", the URL is: ${servletURL}?reportlets=%5B${report}%5D&op=view . As shown below:
Address explanation: For the use of the Iframe, please refer to: Iframe , ${report} is the report path passed by the report parameter, op=view specifies that the report preview mode is pagination preview.
4) Add drop-down check box
Switch to the parameter panel, add "label widget" and "drop-down checkbox widget", set the name of the drop-down check box widget to the parameter report , and define the data dictionary, as shown in the following figure:
3. Effect preview
1) PC side
Save the template, click "Data Analysis Preview", the effect is shown in the figure below:
2) Mobile
Does not support mobile preview
III. Template download
1. Master template
The completed template can be found in:
%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Parameter\Dynamic_multi-sheet_display_of_drop-down_checkboxes.cpt
Click to download the template:Dynamic_multi-sheet_display_of_drop-down_checkboxes.cpt
2. Sub-template
1) For the completed template, please refer to:
%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Primary\GroupReport\Group_Report.cpt
Click to download the template: Group_Report.cpt
2) For the completed templates, please refer to:
%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\Form\LineForm\LineForm1.cpt
Click to download the template:LineForm1.cpt