We will introduce how to add report control of FineReport reporting tool in this article.You will understand how to add and submit an event.

1. Description

The Previous Section has introduced the design of filling report style. Then, can we directly preview templates and enter data in the web side after report style is designed? Of course not. In FineReport, to enter data in web side, you need to bind control to the cell. The cell can only be edited after control binding. Next, we will introduce how to add control to a cell and how to set attributes.

2. Add control

Add control is to bind control to a cell. In this case, when previewing template filling, you can edit the cell and enter or change data.

To better meet filling requirements and adapt to various data entry types, FineReport provides different filling controls for selection, like drop-down box, check box group, etc. For detailed control types, refer to Filling Control.

Next, we will bind control to each cell. Based on different meanings of data entered in a cell, the control types bound to cells are also different.

2.1 Text control

Add control

Set control types of C4, C6, C10, C11, H4, F8, G10, G11 as Text. Select specific cell and right click to select Control Setting. Select default text control from the Control Type drop-down box, as shown below:

Set filling rules

Set filling rules of C11, G10, G11 as Mobile Phone, Postcode and Telephone Number. Select these cells separately. Right click to select Control Setting. Select corresponding rule from the Filling Rule drop-down box of Control. Or, you can custom one:

2.2 Option button group

Follow the method above to set the control type of F6 as Option Button Group.

Data dictionary

Different from text control where data is input manually, option button group, as its name suggests, requires several alternative options. Then, how to add options for the option button group? Then, we will introduce how to bind data to control in FineReport reporting software.

Select the cell and right click to select Control Setting. In the Control Setting Panel, switch to the Data Dictionary label. Select the Type Set as Custom. Click Add button to add custom data for the control, as shown below:

Actual value: the value entered to the database in filling;

Display value: the value displayed when you view report in the web side, which corresponds to the actual value one by one.

2.3 Date control

Set the Control Type of C7 and F7 as Date Type. The Return Value Type is default Character String Type, as shown below:

2.4 Drop-down box control

Set the C8 Control Type as Drop-down Box, Data Dictionary as Data Query, Data Set Name as ds1, and Actual Value and Display Value as Title. Preview the template. When the drop-down box control is used, the title field values in the ds1 data set will be all loaded to the drop-down option, as shown below:

Similarly, set the C9 Control Type as Drop-down Box, Data Dictionary also as Data Query, Data Set Name as ds1, and Actual Value and Display Value as Area.

Set the F9 Control Type as Drop-down Box, Data Dictionary also as Data Query, Data Set Name as ds1, and Actual Value and Display Value as City.

2.5 File control

Cell H6 control is used to upload user photo. Therefore, set the H6 Control Type as File Control and check Only Support Monofile Upload, as shown below:

2.6 Text field control

Cell B13 is used to input remark information. As remark information is long in general, set B13 Control Type as Text Field, as shown below:

Set effect is as follows: