Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

Insert and Delete Button

I. Overview

If there is an operation of inserting and deleting records when data entry, then you need to click the button to insert a blank record or delete an existing record. FineReport provides 2 methods for setting the insert and delete buttons, which are as follows:

  • Built-in insert and delete button (does not support mobile terminal)

  • Customize insert and delete buttons (support mobile terminal)


II. Built-in insert and delete button

1. Design data entry template

1) Create a new database query data set ds1, and the SQL statement is: select * from sales

2) Design the data entry form, add text widgets to A2-D2 cells, and drag the data set fields into the corresponding cells, as shown in the following figure:

截屏2021-01-13 下午4.46.40.png

3) In the designer menu bar, click Template > Data Entry Attributes to add a built-in SQL submission, as shown in the following figure:



2. Setting insert and delete button

Select Template > Web Attributes from the menu bar of the designer, and select Data Entry Settings > Individually set for the template. Double click to add the Insert record and delete record buttons to the top toolbar, as shown in the figure below

2021-01-13_15-55-59.png


3. Effect preview

Save the template, click data entry preview, and the insert and delete operations are shown in the following figure:

insert record

Delete record


Note: the mobile terminal does not support the insert and delete buttons in the toolbar. Please use the method of user-defined insert and delete buttons below to fill in the mobile terminal.

III. User defined insert delete button

1. Design data entry template

1) Create a new database query data set ds1, and the SQL statement is: select * from sales

2) Design the data entry form, add text widgets to A2-D2 cells, and drag the data set fields into the corresponding cells, as shown in the following figure:

截屏2021-01-13 下午4.46.40.png

3) In the designer menu bar, click Template > Data Entry Attributes to add a built-in SQL submission, as shown in the following figure:


2. Setting the insert row button

Select E2 cell, add a Button widget to the cell, select the Insert row from the button type drop-down list, and set the Specified cell to A2, as shown in the following figure:

截屏2021-01-13 下午4.53.17.png

The property settings of the insert row button are described in the following table:

Button Type Property Description

Insert 

line

Button nameThe text information displayed by the button in the front display. The default is insert line
Button iconThe icon displayed in front of the button name. The default is the green plus sign
Shortcut keynot supported at present
Specify cellTo decide which data entry cell to start adding records, it must be one of the extensible filling cells. For example, in the example, it can only be one of A2 ~ D2
Number of rowsAfter clicking the insert row button, the number of blank record rows that can be added at one time is 1 by default


3. Set delete line button

Select the F2 cell, add a Button widget to the cell, select Delete row from the button type drop-down list, and set the specified cell to A2, as shown in the following figure

截屏2021-01-13 下午4.53.39.png

The attributes settings of the Insert Row button are described in the following table:

Button type
AttributesInstruction
delete row buttonbutton nameThe text information displayed by the button when the front end is displayed, the default is: delete row
button iconThe icon displayed before the button name, the default is a red cross
hot keyShortcut key settings are currently not supported
specified cellSpecifies which cell is the parent to delete, the cell must be set to expandable

Note: The submit event cannot be set in the delete row button, there will be a logic conflict problem. If you want to set it, you have to use the normal buttons.


4. Effect preview

Save the template, click data entry preview, and the insert and delete operations are shown in the following figure:

Insert record

Delete record


2) Mobile terminal

At the same time, it supports filling in the App and H5 ends, and the effect is shown in the following figure:

1.png

IV. Template download

1. Built-in insert and delete button

Completed template, please refer to %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\DataEntryApplication\Builtincpt

Click download template: 

Builtin.cpt


2. Custom insert and delete button

Completed template, please refer to %fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\DataEntryApplication\Button.cpt

Click download template: 

Button.cpt

Attachment List


Theme: Data Entry
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback