# Report not working from Servoy

**URL:** <https://forum.servoy.com/t/report-not-working-from-servoy/15643>\
**Category:** Classic Servoy\
**Created:** [March 9, 2012, 12:28pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643 "2012-03-09T12:28:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jdbruijn](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jdbruijn](https://forum.servoy.com/u/jdbruijn)\
**Post date:** [March 9, 2012, 12:28pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/1 "2012-03-09T12:28:38Z")

</div>

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:

```auto
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:

```auto
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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![logicimpresa](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@logicimpresa](https://forum.servoy.com/u/logicimpresa)\
**Post date:** [March 9, 2012, 2:08pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/2 "2012-03-09T14:08:59Z")

</div>

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

Gianluca

---

<div class="post-metadata">

**Author:** ![jdbruijn](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jdbruijn](https://forum.servoy.com/u/jdbruijn)\
**Post date:** [March 9, 2012, 2:23pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/3 "2012-03-09T14:23:57Z")

</div>

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](https://forum.servoy.com/uploads/short-url/f9OzKLGFP7DVTpBqJPlCAfFxuqZ.txt) (8.97 KB)

---

<div class="post-metadata">

**Author:** ![logicimpresa](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@logicimpresa](https://forum.servoy.com/u/logicimpresa)\
**Post date:** [March 9, 2012, 2:56pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/4 "2012-03-09T14:56:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jdbruijn](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jdbruijn](https://forum.servoy.com/u/jdbruijn)\
**Post date:** [March 9, 2012, 3:00pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/5 "2012-03-09T15:00:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![logicimpresa](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@logicimpresa](https://forum.servoy.com/u/logicimpresa)\
**Post date:** [March 9, 2012, 4:14pm UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/6 "2012-03-09T16:14:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jdbruijn](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jdbruijn](https://forum.servoy.com/u/jdbruijn)\
**Post date:** [March 14, 2012, 8:42am UTC](https://forum.servoy.com/t/report-not-working-from-servoy/15643/7 "2012-03-14T08:42:25Z")

</div>

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