I. Overview
1. Version
Report sever version | JAR package | HTML5 Mobile terminal dispaly plugin version | App version |
---|---|---|---|
10.0 | 2019-12-05 | 10.4.49 | 10.4.49 |
2. Solutions
FineReport supports the mobile terminal to scan the code of the text widget to automatically query the report information, without the need to manually enter the text widget information.
This function is realized by adding an automatic query JS statement in the post-editing event of the text widget : _g().parameterCommit();.
Support range:
App support
The text widget in the report, the text widget in the form.
II. Example
1. Operation steps
1) New template
Open the FineReport designer, clickFile>New GeneralReport, create a new template dataset ds1, and write the SQL query statement: SELECT * FROM Sales_Volume in theDB Querydialog box, and clickOK, as shown in the figure below:
Drag the fields in the template dataset ds1 into the corresponding cells, as shown in the figure below:
3) Click Template>Template Parameters, add parameters in theTemplate Parameters prompt box, and double-click to modify the name of the template parameter to Region, and set the Default Value to blank. As shown below:
Click theEdit button on the parameter panel to enter the parameter panel setting interface. The widget setting panel in the upper right corner will display the parameters without added widgets. Click the Region or click Add All to add the default widget of the parameter to the parameter panel. As shown below:
Click theEdit button of the custom widget, select the text box widget type, and add a Text widget with the widget name region, as shown in the figure below:
Double-click cell A1 to set filter conditions for it, and the region is equal to the parameter$region, as shown in the figure below:
2) Add automatic query JS statement
AddAfter Editing to the text widget: _g().parameterCommit();, as shown in the figure below:
3) Select input method
Select the text widget and select three support methods under Mobile Terminal: Scan Code or Manually Input, Mannual Input Only, Scan Code Input Only. This document selects Scan Code Input Only, as shown in the following figure:
2. Preview effect on mobile terminal
Add the template to the decision-making system and access the template on the mobile terminal.
App display:
Only supports scanning code input, that is, clicking on the entire text widget area will trigger the scanning code, as shown in the following figure:
III. Download template
Please refer to the completed template:
%FR_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\JS\[App] JS_scan_code_query_information.cpt
Click to download: