Note:Overview
Expected Effect
During data entry report creation, you need to obtain numbers in strings dynamically, as shown in the following figure.

Implementation Method
To realize the effect, you can add an After Exiting Edit event for a text widget. For details about the API description, see JS API Summary.
Note:Example
Report Design
1. Create a built-in dataset named Embedded1, as shown in the following figure.

2. Design the table as shown in the following figure. Add a text widget for cell A2.

3. Select cell A2, add an After Exiting Edit event, add a parameter row, and set the parameter value to the formula row(), as shown in the following figure.

The JavaScript code is as follows.
Note: var str = this.getValue();
//Obtain the current value of the text box widget.
var num = str.replace(/[^0-9]/ig, "");
//Extract the number by the regular expression.
_g().setCellValue(1, row-1, num);
//Assign the value (the number extracted above) to cell B2.
Effect Display
Save the report. After clicking Data Entry Preview, modify the values in the text boxes. The numbers after modifications in the current cells will be obtained in the corresponding cells, as shown in the following figure.

Note:Template Download
For details, you can download the template Obtaining the Number in the String in a Cell by JS.cpt.