Jump to content
Changes to the Jaspersoft community edition download ×

problem with subreports and JRBeanArrayDataSo  


Recommended Posts

By: del-piero - del-piero

problem with subreports and JRBeanArrayDataSo Â

2006-01-12 02:51

hi,Â

Â

i have one master report and two subreport when i where using regular connection the subreports where working fine. Â

But when i changed the connection using JRBeanArrayDataSource the subreport stop working at all and i see only the master report...Â

the questions can i use JRBeanArrayDataSource for the report and regular connection to subreports?Â

Â

if the problem is known to you please answer me.Â

Â

thanks a lot.

 

 

 

 

By: Daniel R - doctor_jay

RE: problem with subreports and JRBeanArrayDa Â

2006-01-12 06:39

Hi.Â

Â

Yes, this is possible. One solution might be to pass your Connection object to the report parameters map.Â

Â

//code snipÂ

HashMap map = new HashMap();Â

Connection myConnection = getConnection();Â

map.put("myConn", myConnection);Â

Â

JasperFillManager.fillReport(report, map, new JRBeanArrayDataSource(MyFactory.getBeanArray()));Â

Â

In the subreport elements, you are now able to get the Connection object with <dataSourceExpression><![CDATA[((HashMap)$P{REPORT_PARAMETERS_MAP}).get("myConn")]]></dataSourceExpression>Â

Â

Greetz DanielÂ

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...