Row Insertion and Deletion

  • Last update:June 11, 2024
  • Overview

    Function Description

    If you need to insert or delete records during the data entry, click the button to insert a blank record or delete an existing one. FineReport provides two methods to set the insertion and deletion buttons, as shown in the following figures.

    Built-in insertion and deletion buttons (not supported on mobile terminals).

    Customized insertion and deletion buttons (supported on mobile terminals).

    Built-in Insertion and Deletion Buttons

    iconNote:

    This solution does not support mobile preview. If you have requirements for mobile terminals, do not use this solution.

    Data Entry Template Designing

    1. Create a database query dataset named ds1 and enter the SQL statement SELECT * FROM Sales.

    2. Design the data entry table, add text widgets to cells A2 to F2, and drag the dataset fields into the corresponding cells, as shown in the following figure.

    3. Choose Template Data Entry Attribute on the menu bar and add a built-in SQL submission, as shown in the following figure.

    Insertion/Deletion Button Setting

    Choose Template > Web Attribute on the menu bar. On the opened page, choose Data Entry Setting > Set for This Template Separately. Double-click the Insert Record and Delete Record buttons to add them to the top toolbar, as shown in the following figure.

    Effect Display

    Save the template and click Data Entry Preview. The following figures show how to insert and delete records.

    Record Insertion

    Record Deletion

    iconNote:

    1. Through this method, you can insert or delete a record using the cell where your cursor hovers as the parent cell. Therefore, ensure that the cursor hovers over the correct cell before you click the button.

    2. This solution does not support mobile preview. If you have requirements for mobile terminals, do not use this solution.

    Insert/Delete Button Customization

    iconNote:
    The solution supports mobile preview.


    Data Entry Template Designing

    1. Create a database query dataset named ds1 and enter the SQL statement SELECT * FROM Sales.

    2. Design the data entry table, add text widgets to cells A2 to F2, and drag the dataset fields into the corresponding cells, as shown in the following figure.

     

    3. Choose Template > Data Entry Attribute on the menu bar and add a built-in SQL submission, as shown in the following figure.

    Row Insertion Button Setting

    Select cell G2, add a button widget to the cell, set Button Type to Insert Row and Specified Cell to A2, and leave the left settings as default values, as shown in the following figure.


    The following table describes attribute settings for the Insert Row button.

    Button Type
    AttributeDescription

    Insert Row button

    Button Name

    Text information (Insert Row by default) displayed on the button during the front end display.

    Button Icon

    Icon (green plus sign by default) displayed in front of the button name.

    Shortcut Key

    Shortcut key setting, which is not supported currently.

    Specified Cell

    Cell to be specified as the parent cell to insert rows. This cell must be set to be expandable.

    Number of Rows

    Number of rows (1 by default) that can be inserted each time when you click the insertion button.

    Delete Row Button Setting

    Select cell H2, add a button widget to the cell, set Button Type to Delete Row and Specified Cell to A2, and leave the left settings as default values, as shown in the following figure.

    The following table describes attribute settings for the Delete Row button.

    Button Type
    AttributeDescription

    Delete Row button

    Button Name

    Text information (Delete Row by default) displayed on the button during the front end display.

    Button Icon

    Icon (red cross sign by default) displayed in front of the button name.

    Shortcut Key

    Shortcut key setting, which is not supported currently.

    Specified Cell

    Cell to be specified as the parent cell to delete rows. This cell must be set to be expandable.

    iconNote:
    You cannot set a submission event for the row deletion button in case logical conflicts occur. If you have to set a submission event, you must use a general button.

    Effect Display

    PC

    Save the template and click Data Entry Preview. The following figures show how to insert and delete records.

    Record Insertion

    Record Deletion

    Mobile Terminal

    The function is also supported on the DataAnalyst app and H5 terminals, as shown in the following figure.

    iconNote:
    Through the deletion button, you can only delete data from the page (without any interaction with the database).

    Template Download

    Built-in Insertion and Deletion Buttons

    You can download the template: Built-in Insertion and Deletion Buttons.cpt.

    Custom Insertion and Deletion Buttons

    You can download the template: Custom Insertion and Deletion Buttons.cpt.

    Notes

    1. Row insertion/deletion will trigger a recalculation of all the formulas on the page, resulting in a refresh effect. Therefore, row insertion/deletion will also be slower if the page loads slowly (caused by operations such as the enabling of the Display Widget Directly function or using of SQL functions). In this case, you can suffix the URL with the parameter &async_insert=true to enable partial refresh after inserting rows, accelerating row insertion regarding large amounts of data.

    2. Row insertion/deletion will trigger the after-the-load event of the page.

    3. The row insertion strategy will affect the values of the cells in the inserted row.

    4. When you insert or delete rows, the real-time calculation effect of hierarchical coordinate functions is not supported.

    Attachment List


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

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy