Jump to content

passing connecttion and datasource together


itpragmatic

Recommended Posts

Experts,

1. I would like to know whether we could pass connection and JRDataSource altogether in function? If filename is source filename, jasperParameter is hashMap, conn is connection and jbs is datasource, then in any scenario can we pass all these together like following? I believe we can not do that but I would like to confirm about it from the experts.

JasperPrint print = JasperFillManager.fillReport(fileName, jasperParameter, jbs,conn);

2. Another question in my mind is I have one main report along with 2 subreports. Main report and subreport2 uses connection while subreport1 does not use the connection but JRDataSource. In this scenario what should be done if I want to generate those reports? One with JRDataSource and 2 with connection. This is why i asked first question. I have already created a bean for the datasource and was able to display it through ireport but my concern starts when I start to use JasperFillManager. Please do let me know your ideas and suggestions. Your help is appreaciated. Has anyone gone through similar scenario?

 

Following is what I thought.

3. If I combine Main report and subreport1 and if i create its bean....then is it going to work? I mean to say creating beans for main report and subreoprt1 and pass datasource only through subreport2. Is is feasible and possible? Or I am tinking out of track? Please do let me know if anybody knows the answers. Thank you very much.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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