savePanelData JavaScript function

All input JSP pages must include this function.

function savePanelData()
{
 
 var reportInputData = new Object();
    
   reportInputData.SQLid = "the requested report  name" ;
 reportInputData.reportXML = "some file";
   reportInputData.variable1 = "some value 1";
   reportInputData.variable2 = "some value 2" ;
 .
   .
   .
 reportInputData.variableN = "some value N";
   reportInputData.varProperties = "a list of variable separated by a comma";
   parent.put("reportInputData", reportInputData);
 
 // The section below can be used to indicate a different View to be used
 // var reportResultPage = new Object();
 // reportResultPage.cmd = "ASpecificDisplayReportView";
 // parent.put("reportResultPage",reportResultPage);
 
   return true;
}

The references to reportInputData and reportResultPage are required to pass the parameters to the controller command. The SQLid and reportXML variables are also required. The variable1 through variableN, and varProperties are optional. In the example variable1 through variableN represent the variables used in the SQL query. For example, variable1 and variable2 could be replaced by beginDate and endDate. Thus the following code would be present inside the savePanelData() function:

reportInputData.begindate = " some value";
reportInputData.enddate   = " some value";

The varProperties variable lists variables which obtain their values from a properties file. For example, it might look similar to the following:

reportInputData.varProperties = "revenue,orders,pages,customers,visits";

If the object reportResultPage is not referenced in the JSP, then the controller command sets it to use the generic view provided by the reporting framework to display the report. By setting reportResultPage.cmd, you have the ability to specify which view to use.

Related concepts

Related reference