I. Overview
1. Application scenarios
When designing the data entry template, some data can be skipped and not filled in. It is hoped that these empty data can be saved as 0 when entering the database.
In other cases, the database table field is not a bound cell, but you want to directly store the parameter value, date, current time, etc. So how to achieve it?
2. Implementation ideas
When setting the built-in SQL submission, the value corresponding to the column does not have to use cells, but can also use data in other formats. There are nine kinds of data, as shown in the figure below:
II. Examples
1. Data preparation
Create a new general report and a new database query dataset. The SQL statement is: select * from ordersdetail
2. Design report
Design the data entry report, and add Text Widgets to cells A3-D3, as shown in the figure below:
3. Setting data entry attributes
New built-in SQL submit, ID is bound to cells, and other fields are bound to formulas.
Take the productID as an example, and its value is the formula: if (len (B3) = = 0, 0, B3), which means that if the cell is empty, 0 will be entered into the database; if not, cell data will be entered.
Other fields are set in the same way. You only need to change the next cell, as shown in the figure below
4. Effect preview
1) PC terminal
Save the template and click Date Entry Preview to add a new record, as shown in the figure below:
After successful submission, the warehousing data is as follows:
2) Mobile terminal
It supports both App and H5 previews, the effect is as shown below:
III. Template download
Completed template, please refer to
%fr_HOME%\webapps\webroot\WEB-INF\reportlets\doc-EN\DataEntry\DataEntryApplication\valueProcess.cpt
Click download template: