JS implementation: click the parameter panel button to display or hide data

When there are too many data listed in the report, you want to hide the detailed data and only display the statistical data through the display button. As shown in the following figure, how to implement it? Taking finereport as an example, this paper describes how JS can click the parameter panel button to display or hide data.

Open report

Add a label control in the parameter panel. The control name is label. Set the label control invisible and the control value to display.

Add a button control in the parameter panel with the control name of button and the control value of "display only total data", and add a click event.

Edit the click event and add the following JavaScript code:

Click the blank space of the parameter panel to remove the check box of "do not display report content before clicking query".

Return to the report design interface, right-click cell B3, add the condition attribute, set the row height to 0 mm, and add the formula condition to $label = 'hidden'.

Save the template and click pagination preview to see the effect shown in the figure above.

The above is the whole content of this article. I hope the content of this article can bring some help to your study or work. At the same time, I also hope to support a lot of programming tips!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>