I. Overview
1. Problem description
Some templates have a large amount of data, but there is no need for modification. They only want to find out the data and submit them directly to the database. When using the default submission, you must preview it first, and then click to submit. When the amount of data is large, previewing the page will be very slow or even stuck. Is there any way to submit to the database directly without previewing it?
2. Solution
When accessing the template, splicing the &format=submit behind the url, you can directly submit the data into the database.
Note: When using normal submission, the verification and page event will no longer take effect.
II. Example
1. Prepare tables
First, create two new tables in FRdemo: Sales_format and Sales_format1.
Sales_format imports a certain amount of data as the table to be queried, and Sales_format1 is empty as the database table to store the data. These two tables have the same structure, as shown in the following figure:
2. Design report
1) Create a new general report, create a new dataset ds1, the SQL statement is: SELECT * FROM Sales_format
2) Drag the fields in the dataset to the corresponding cells, so that you can see the results of the query when previewing on the front end, as shown in the following figure:
3) Create a new built-in SQL submission, select Sales_format1 in the database, and bind cells A2~C2 with the fields in Sales_format1, as shown in the following figure:
3. Preview effect
1) Normal way
From the figure below, you can see that it takes a long time to wait for the query results to come out before submitting them to the database, which is inefficient.
2) Submit directly
Enter http://localhost:8075/webroot/decision/view/report?viewlet=Reuse%252FSubmit_to_database_directly.cpt&op=write&format=submit on the web page to skip the preview and submit the data directly to the database. Compared with the normal method, the speed is significantly faster.