<< Click to Display Table of Contents >> Global Function |
The global function means that a function defined outside the product can be called by the product and can be called repeatedly. For example, in many reports may use the same function, if you need to redefine the function in each report, it is too complicated, so the function is defined on the outside of the product, only need to call when used It can be used.
Features:
Need to add in bi.properties: script.functions.path=cmnetFunctions. Where cmnetFunctions is the name of the added file.
➢For example: create a new file called test.java, the content is:
function testAdd(a,b) {
return a + b;
}
Configured in bi.properties: script.functions.path=test.java
Then create a new text component in the dashboard and select the script in the right panel settings. In the script, enter: Text1.data = testAdd("Hello ","Yonghong"). As shown below:
The effect shown is :