I. Overview
1.1 Requirement
How to get report body widget value by appropriately setting the parameter pane of the decision-making report?
1.2 Solution
Get report body widget value by inputting JS code:
_g().getWidgetByName("area").getValue(); // Get the value of the Area Widget for the report body.
II. Steps
1) Create a new decision-making report and set the body’s Layout Type as Absolute Layout:
2) Drag the Label Widget and the Text Widget into the report body and set the value of the Label Widget as Area:
3) Set the name of the Text Widget as area:
4) Drag the parameter pane into the report body, add a Button Widget, and set the Widget Name as Get report body widget value:
5) Select the button0 and add a Click Event:
Input the JS code:
var label = _g().getWidgetByName("label0").getValue(); // Get the value of label0
var area = _g().getWidgetByName("area").getValue(); // Get the value of areaalert(label + area);
6) Click the white space of the parameter pane and uncheck [Display Nothing Before Query]:
7) Save the template and click [Preview]. The preview effect is shown as above.
III. Preview
Save the templates and select [Dashboard Preview]. The preview effect is as shown below: