I’ve got a problem with a Jasper Report with a crosstab inside. The report has a param P_SQL which is the sql query for the crosstab, the SQL Builder in iReport has $P!{P_SQL} to load the query, and when I run the report using a default setting of this param it works from iReport.
When I try to feed the SQL from servoy I get an error:
Exception Object: java.lang.Exception: Error evaluating expression :
Source text : $F{row_data}
MSG: Error evaluating expression :
Source text : $F{row_data}
I’m using the following function to show the report:
function runReport(event)
{
var vSQL = getSQL();
application.output("Jasper version: " +plugins.jasperPluginRMI.pluginVersion);
var _params = new java.util.HashMap();
_params.put("P_SQL",vSQL);
plugins.jasperPluginRMI.runReport(forms['frmReport'].foundset,'report1.jasper',null,OUTPUT_FORMAT.VIEW,_params)
}
the SQL I use:
SELECT project_name AS row_data, start_date AS col_data, CASE WHEN call_reportdate BETWEEN start_date AND end_date THEN 1 ELSE NULL END AS cel_data
FROM ( SELECT call_id, call_reportdate, call_objectid, date '2012-01-01' + (n || ' month')::interval AS start_date, date '2012-01-01' + ((n + 1) || ' month')::interval - '1 minute':: interval AS end_date
FROM calls CROSS JOIN generate_series(0,3) n
WHERE call_reportdate BETWEEN '2012-01-01' AND '2012-03-09') AS T
LEFT JOIN objects ON call_objectid=object_id
LEFT JOIN projects ON object_projectid=project_id
WHERE call_objectid IS NOT NULL
GROUP BY project_name, start_date, call_reportdate, end_date
I dont understand what the problem can be, because the report works when I use the same query from the iReport Designer. Any hints are welcome.