Overview
Version
Version | Functional Change |
11.0.1 |
|
Application Scenario
Data entry temporary storage can store the filled content. When you go to the data entry page again after leaving or refreshing the page, the previously filled data is displayed.
After you refresh the page, the previously filled data is still retained, as shown in the following figure.
In FineReport 11.0.1 and later versions, if temporary data exists on the page, the prompt "Temporary data has been read" pops up after the page is reloaded.
Function Logic
Support manual and auto temporary storage.
Store temporary data in the platform database. After clearance or successful submission, temporary data is deleted.
Store temporary data according to the logged-in user.
Not store images and uploaded files in file widgets. Not support mobile terminals and templates with charts.
Not support temporary storage of page data through different query parameters.
Temporary Storage Method
Manual Temporary Storage
Add the Temporary Storage button to the toolbar. Click the button to store the filled page data.
Choose Template > Web Attribute on the designer menu bar, chooseData Entry Setting > Set for This Template Separately on the opened editing page, select the Temporary Storage button, and add the button to the top toolbar.
The following figure demonstrates how to perform manual temporary storage during data entry preview.
Auto Temporary Storage
The system automatically stores the filled data during data entry preview.
Choose Template > Web Attribute on the designer menu bar, choose Data Entry Setting > Set for This Template Separately on the opened editing page, and tick Auto Temporary Storage.
The following figure demonstrates the manual temporary storage effect during data entry preview.
Temporary Storage Viewing
Temporary data during data entry preview is stored in the PUBLIC.FINE_WRITE_STASH table in the FineDB database on the platform.
Data Connection Creation
Choose Server > Define Data Connection on the designer menu bar and create a JDBC data connection.
The following table shows the connection configurations.
Attribute | Value |
Database | Others |
Driver | com.fr.third.org.hsqldb.jdbcDriver |
URL | jdbc:hsqldb:file://${ENV_HOME}/embed/finedb/db |
Username | sa |
Password | Not required |
Temporary Data Viewing
Create a data query dataset, select FineDB as the database, and enter the SQL statement: SELECT * FROM PUBLIC.FINE_WRITE_STASH.
All data in the PUBLIC.FINE_WRITE_STASH table is temporary data.
The following table describes the fields in the data table.
Field | Description |
ID | Primary key |
DATA | Temporary data (displaying cell name + filled content in CSV format) |
REPORTPATH | Report path (physical path rather than platform path) |
USERNAME | Username |
Clearance
Add the Clear button to the toolbar. Click the button to manually clear the stored temporary data.
Choose Template > Web Attribute on the designer menu bar, choose Data Entry Setting > Set for This Template Separately on the opened editing page, select the Clear button, and add the button to the top toolbar.
The following figure demonstrates how to perform manual clearance during data entry preview.
Notes
Temporary Storage Permission
ProblemIf template authentication is not enabled for the platform, you can directly access the data entry template through the URL without login. In this case, if temporary data is stored, the USERNAME field is empty in the PUBLIC.FINE_WRITE_STASH table. Different users can share and view the stored temporary data.
Solution
To avoid the above problem, template authentication needs to be enabled for the decision-making platform, forcing users to log in to view and perform operations on templates. For details, see Template Authentication.
Invalid Temporary Storage
Problem
If the first column in the data entry template is blank and set to not expand, data entry temporary storage will be invalid.
Solution
Method 1: Delete the blank column.
Method 2: Set cell expansion for the blank column.
No Auto Clearance After Custom Submit Event Submission
Problem
The system does not automatically clear temporary data after the submit event (set through the custom button) is submitted. Then abnormal page display may occur, such as blank lines or misalignment.
Solution
Clear temporary data through JS in the callback function of the custom submission event.
JavaScript codes are as follows:
if (fr_submitinfo.success) {
_g().clear(undefined, false);
FR.Msg.toast('Successful submission');
} else {
FR.Msg.toast('Failed submission, error message: ' + fr_submitinfo.failinfo);
}