Hi I am following a tutorial and I have inserted this code into the open script in BIRT Eclipse.
maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName());
maximoDataSet.open();
var sqlText = new String();
// Add query to sqlText variable.
sqlText = " select workorder.wonum, workorder.description, workorder.status, workorder.worktype, "
+ " workorder.wopriority, workorder.reportdate, workorder.estdur, workorder.location "
+ " from workorder "
// Include the Maximo where clause
+ " where " + params["where"]
;
maximoDataSet.setQuery(sqlText);
However I am receiving the following error when trying to preview the report:
ReportDesign (id = 1): + There are errors evaluating script "maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName()); maximoDataSet.open();
var sqlText = new String();
// Add query to sqlText variable. sqlText = " select workorder.wonum, workorder.description, workorder.status, workorder.worktype, " + " workorder.wopriority, workorder.reportdate, workorder.estdur, workorder.location " + " from workorder " // Include the Maximo where clause + " where " + params["where"] ;
maximoDataSet.setQuery(sqlText);": Fail to execute script in function __bm_OPEN(). Source: ------ " + maximoDataSet = MXReportDataSetProvider.create(this.getDataSource().getName(), this.getName()); maximoDataSet.open();
var sqlText = new String();
// Add query to sqlText variable. sqlText = " select workorder.wonum, workorder.description, workorder.status, workorder.worktype, " + " workorder.wopriority, workorder.reportdate, workorder.estdur, workorder.location " + " from workorder " // Include the Maximo where clause + " where " + params["where"] ;
maximoDataSet.setQuery(sqlText); + " ----- A BIRT exception occurred. See next exception for more information. Wrapped com.ibm.tivoli.maximo.report.script.MXReportRuntimeException: java.lang.NullPointerException (/report/data-sets/script-data-set[@id="5"]/method[@name="open"]#2).
Does anyone know why this may be?
Thanks.