Dashboard Data Entry

  • Last update:August 19, 2024
  • 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.

    2024-06-14_16-49-38.png

    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.

    2024-06-14_16-53-29.png

    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.

    2024-06-14_16-54-20.pngAdding 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.

    iconNote:

    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');
    }

    iconNote:
    The success prompt only indicates that the backend program is executed without any exceptions. The final submission result may be affected by the settings and may not be the same as expected.

    Effect Display

    PC

    Save the template and click Preview. The following figure shows the preview effect.

    2024-06-27_15-24-54 (2).gif

     

    Mobile Terminal

    App

    HTML5


    Example Two

    Achieve the dashboard data entry function by inserting Iframe Widget into the report.

    iconNote:
    Mobile terminals do not support Iframe Widget.

    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.


    iconNote:

    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.

     2024-06-27_16-23-14 (1).gif

    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

     


    Attachment List


    Theme: Data Entry
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    9s后關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy