Overview
Problem
Most of the data entry templates are in the CPT format, which supports better settings and functions than the FRM format. If you have a high demand on page layout flexibility, you can use FRM templates. However, unlike CPT templates, FRM templates do not support data entry preview. So how can you achieve the data entry function when using FRM templates?
Solution
1. You can achieve the dashboard data entry function by adding a Submit to Database event to the button widget.
2. You can achieve the dashboard data entry function by inserting Iframe Widget into the report.
Example One
Achieve the dashboard data entry function by adding a Submit to Database event to the button widget.
Template Design
Report Content Design
Create a dashboard, and design the report as shown in the following figure.
The left column is for label widgets, and the settings for widgets in the right column are as follows.
Description | Widget Type | Widget Name | Widget Value | Data Dictionary |
Name | Text Widget | name | if(len($fr_username)=0,"admin",$fr_username) | / |
Leave Type | Drop-down Box Widget | type | / | Personal Leave, Sick Leave, and Annual Leave |
Start Time | Date Widget | startday | now() | / |
End Time | Date Widget | endday | now() | / |
Days of Leave | Text Widget | day | DATEDIF($startday,$endday,"D")+1 | / |
Leave Reason | Text Area Widget | reason | / | / |
Submit | Button Widget | submit | / | / |
Mobile Style Adjustment
Adjust the width and height of the dashboard and deselect App Relayout, as shown in the following figure.
Adding an Event for Submitting Data to the Database
Select the Submit button widget, choose Component Settings > Event, and add a click event.
Add a Submit to Database event. The table to which data is to be submitted is Leave. The following figure shows the corresponding values.

If a $ symbol is in front of a value, the value is referenced from the corresponding parameter widget.
Setting a Callback Function
When you use the button to set the submission operation, no success or failure prompt is displayed by default. You need to set a callback function to prompt whether the submission is successful or not, as shown in the following figure.
The corresponding JavaScript codes are as follows.
if (fr_submitinfo.success) {
FR.Msg.toast('Successful Submission');
} else {
FR.Msg.toast('Submission Failure');
}

Effect Display
PC
Save the template and click Preview. The following figure shows the preview effect.
Mobile Terminal
App
HTML5
Example Two
Achieve the dashboard data entry function by inserting Iframe Widget into the report.

Plugin Installation
Install the Iframe Widget plugin.
Adding Iframe Widget
Choose Widget > Iframe Widget and drag the widget to the dashboard body frame to add an iframe widget rHIframe0, as shown in the following figure.
Setting Addresses and Parameters
Select the Iframe Widget, choose Component Settings > Attribute > Address, and configure the corresponding template (Template Path or URL), as shown in the following figure.

The template URL must be suffixed with the parameter &op=write (to achieve data entry preview).
Effect Display
Save the template and click PC Preview. The following figure shows the preview effect.
Template Download
Example One
Click to download the template: Dashboard Data Entry - Example 1.frm
Example Two
Click to download the template: Dashboard Data Entry - Example 2.frm