<< Click to Display Table of Contents >> Navigation: »No topics above this level« TOC : Script API > JavaScript > JavaScript API > Component > ReportTemplate > Method >GetGlobal |
Gets the global variables.
Prototype :
var GetGlobal
(
string Key
)
Arguments :
Key |
name of the global variable |
Example :
//define a Global object of text type
ReportTemplate.SetGlobal("Title", "OZ Report");
//get the Global object set as text type
_TraceLn(ReportTemplate.GetGlobal("Title"));
//define a Global object of JSON string
ReportTemplate.SetGlobal("DeptCode", "[{\"code\":\"100\"}, {\"code\":\"200\"},{\"code\":\"300\"}]");
//get the Global object set as JSON string
var arrTemp = JSON.parse(ReportTemplate.GetGlobal("DeptCode"));
for(i=0; i<arrTemp.length; i++) {
_TraceLn(arrTemp[i].code);
}
//define a Global object as an array
var Values = new Array();
Values[0] = 100; Values[1] = 200; Values[2] = 300;
ReportTemplate.SetGlobal("DeptCode", Values);
//get each element of Global object array
var arrTemp = ReportTemplate.GetGlobal("DeptCode");
for(i=0; i<arrTemp.length; i++) {
_TraceLn(arrTemp[i]);
}
Available Events :
All Events