Overview
Related Video
Application Scenarios
When designing a report form, if you need to modify or add data, you should add a form widget to the cell where the data is entered.
FineReport has 16 types of widgets for different needs.
Function Entrance
How to add a form widget to a cell: Select the cell, choose Widget Setting in the right-hand property panel, click the drop-down list of Select Widget, and choose the desired widget. As is shown below:
Widget Types
The table below provides a brief introduction to the usage scenarios of 16 types of widgets. Click the corresponding hyperlink to view the detailed introduction of each widget.
Type | Widget Name & Help Document | Application Scenario |
Filling in | Fill in single-line text information, such as name, email, phone number, zip code and so on. | |
Text Area Widget | Fill in multi-line text information, such as personal introduction, product description, questionnaire survey and so on. | |
Fill in numbers, such as sales, profits, grades and so on. | ||
Password Widget | Fill in passwords, which will be invisible as they are typed | |
Clicking | After clicking, a certain effect is achieved, such as inserting a row button when filling in a form, deleting a row button when filling in a form and so on. | |
Selecting | Multiple data can be selected at the same time for processing, such as batch deletion, submission, modification and so on. | |
There are multiple data items to choose from, but only one can be submitted, such as single-choice questions in exams or questionnaires and so on. | ||
There are multiple data items to choose from, and multiple submissions can be made at the same time, such as multiple choices on a test paper, multiple choices on a questionnaire and so on. | ||
Click the drop-down box to display multiple options, select one of them and fill it into the cell. | ||
Click the drop-down box to display multiple options, and you can select multiple options to fill in the cell at the same time. | ||
Select a date and fill it into the cell. | ||
File Widget | Save uploaded files to a database table | |
List Widget | The options are displayed in list form. You can select one and submit it. | |
Iframe | Insert other web pages or reports into cells | |
Select the option under the tree structure to fill in the cell, and then submit. Single or multiple selections are supported. | ||
Select the options under the tree structure and submit directly, supporting single or multiple selection. |
Setting Default Values for Form Widgets
If you want a widget to have a default value when filling out the form, simply fill it in the cell where the widget is located when designing the form template.
For example, if you want to assign a default value to the date field in the template below and dynamically display today's date, you just need to write the formula =today() in the cell of the date when designing the template, as shown in the figure below:
Notes
Data Dictionary Linkage Clearing the Widget Value
Under the current function design, when the widget triggers data dictionary linkage, it will clear the value of the linked widget.
Parameter Panel Widgets with Values Calculating the Data Dictionary During Initialization
For parameter panel widget with data dictionary settings, if there is no default value, the data dictionary will be calculated only when the option is triggered by clicking the widget; if there is a default value, the data dictionary will be calculated when the widget is initialized. Therefore, setting default values will have a significant impact on the overall loading speed of the template when the SQL execution speed of the data dictionary is slow.
Returning the Previous Input Value If You Enter Text or Number Widgets Not Complying with the Validation Rules
For text or number widgets with validation rules, when the input value does not meet the rules, the corresponding prompt will be displayed, and the current input value will be cleared, returning to the previous input value.
The Digit Loss Precision of Widget's Data Dictionary
Note: Starting from version 11.0.6, the digital type precision of the widget's data dictionary is more accurate, and the following issues will no longer occur.
When the field type used in the widget's data dictionary is numbers, such as bigint, there may be a problem of losing precision, as shown in the figure:
The solution is to convert numbers to strings, and you can perform the conversion in SQL, as shown in the following figure:
The Drop-down Widget Cell Format Not Taking Effect
If you set the data dictionary format of drop-down widget and drop-down checkbox widget cells, and the data dictionary references a dataset that contains dataset parameters, the format will not take effect during front-end preview.