Report not working from Servoy

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.

Hi Jos,
Check in the report as the field is set ROW_DATA: is likely to be set to a different format.

Gianluca

Hi Gianluca,
thank you for your reply. I’ve rechecked the report (both designer and in xml view) and as far as I can see all instances of the row_data field are of class java.lang.String. I’ve included the report file.

I just find it very strange that the report is working with exactly the same sql query from within iReport and not when I call the report from Servoy.

Jos.

report1.txt (8.97 KB)

Hi Jan,
The problem only occurs with this report? The plugin is compatible with the version of iReport?
I found that the plugin does not work properly with files compiled by iReport with versions higher than 4.02.

Yes other reports work correctly.
I’m using iReport 4.0.0 and JasperReports plugins 3.2.0

You can try using iReport 4.0.2 or use the .jasper file to see if the problem is resolved.

I’ve located my problem, it was a typo on my part where I send the SQL to the report.