Successfully!

Error!

You are viewing 10.0 help doc. More details are displayed in the latest help doc

JS Automatic Query in Dashboards

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: Secondary Development
Already the First
Already the Last
  • Helpful
  • Not helpful
  • Only read

Doc Feedback