JS Automatic Query in Dashboards

  • Last update:December 16, 2020
  • I. Overview

    1.1 Requirement

    In a decision-making report, we expect the report body to automatically inquire and display the filtered results without clicking the query button after selecting a parameter in the parameter pane.


    1.2 Solution

    You can add a JS script in the template:

    _g().parameterCommit();

    II. Steps

    2.1 Create a new decision-making report

    Create a new decision-making report and drag a parameter pane and report block into the decision-making report.


    2.2 Data configuration

    Add dataset [ds1] by inputting the SQL statement: 

    SELECT * FROM Sales_Volume WHERE Region='${Region}'

     

    2.3 Add a parameter pane

    Drag the parameter pane into the report body, select the parameter pane and click Add All at the upper right corner. The parameter Region just generated will be added to the parameter pane.

     

    Note

    Widgets in the body of the decision-making report cannot use the JS automatic query and must be in the parameter pane.

     

    2.4 Set parameter widgets

    1) Set the widget type of the parameter Region as Drop-down Box, widget name as Region; select data dictionary as Database Table, DB as FRDemoEN, database table as Sales_Volume and the column names of Actual Value and Display Value both as Region, as shown below:

    2) Click the drop-down box of the parameter Region, select the event pane at the bottom of the Widget Setting pane and click Add an After Editing event, as shown below:

     

    Input the JS code:

    _g().parameterCommit();

    Note

    JS should be added to an Edit End event on a mobile terminal.


    2.5 Add a report block

    Drag the report block into the report body, with the report block designed as follows:

     

    III. Preview

    Save the templates and select [Dashboard Preview]. The preview effect is as shown below:

    IV. Download the template

    Attachment List


    Theme: FineVis Data Visualization
    • Helpful
    • Not helpful
    • Only read

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

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

    不再提示

    10s後關閉

    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