iReport error compiling report with subreport.

Hi all and happy new year:

I created one report with one subreport following the indications of the web:

The process is the following:
1.- Developer: Call Jasper plugin sending as parameter the foundset for the subreport with name “foundsetSubReport” ¿ok?
2.- iReport → Report: I defined one field with name “foundsetSubReport” and type “java.lang.String”.
3.- iReport → Subreport: I created one new parameter calling “foundsetSubReport” with type “net.sf.jasperreports.engine.JRDataSource”

I not compiled the report “Report” because :
Can not cast from string to JRDataSource" Objetc: fx $F{foundsetSubReport}

I proved in the point 2 to change the type to “net.sf.jasperreports.engine.JRDataSource” although not appears in the drop-down. I compiled the report “Report” without errors but when you call it from servoy, returns the error:
Error evaluating expression: Source text: $F{foundsetSubReport}.

Somebody can open my eyes?

Best regards.

iReport 3.7.1
Servoy Version: 5.2.2 - build 1002

Adelo,

The subreport input is the foundset (customers_to_orders), this should be declared as JRDataSource, not String.

In the case you have a report on customers with for each customer a subreport with their orders, you do not need a parameter.
In that case you just define the field (customers_to_orders) of type JRDataSource, and the subreport-foundset will be created for each active customers record.
The runreport is called with the customers foundset on the main report.

Rob