Overview
Expected Effect
During report development, you often want to customize the number of rows to be added, rather than adding one row at a time with one click.
The following figure shows the effect.
Implementation Method
You can add a JS Click event for a button widget located in a cell to realize the function of customizing the number of rows by the appendReportRow() function. For details about the API description, see Exclusive API for Data Entry Preview.
Example
Designing the Report Style
1. Create a template, design the report style, and add text widgets for cells A3 to F3, respectively, as shown in the following figure.
2. To work with the Insert Row button (to be added later), select cell A3 and set Expansion Direction of cell A3 to Vertical, as shown in the following figure.
Adding a Button Widget
Add a button widget for cell G3, set Button Type to Insert Row, set Specified Cell to A3, and modify Number of Rows to 0, as shown in the following figure.
Adding a Click Event
Add a Click event, which specifies the number of rows to be inserted based on the entered number, for the button widget in cell G3, as shown in the following figure.
The JavaScript code is as follows.
num = prompt("The number of rows to be inserted: ","");
_g().appendReportRow(this.options.location, this.options.reportIndex,num)

Preview Effect
PC
Save the template and click Data Entry Preview. The following figure shows the effect.
Mobile Terminal
The following figure shows the preview effect on the DataAnalyst app and the HTML5 terminal.
Template Download
For details, you can download the template Inserting a Custom Number of Rows by JS.cpt.