Jump to content

different data source for multiple sub reports


evanspaiva

Recommended Posts

I have a Master Report and 4 sub reports say A,B,C and D.

Data in sub report A does not repeat.

Data in sub report B repeats dynamically.

Data in sub report C is a Table layout repeats dynamically

I am using TablelModelDatasource to populate the data from jswing application.

Question:How do i pass different TableModeldatasource say DS1,DS2,DS3,DS4 to sub report A,B,C, D individually.

At the moment , i tried the below options.

1. Passing master report datasource to sub reports. Problem : Sub Report B did not have any data to print.

2.Passed the same datasource using the below method to sub report A and B


  JasperFillManager.fillReportToFile("masterreport.jasper", parameters, new JRTableModelDataSource(new

CustomTableModel()));
JasperFillManager.fillReportToFile("subreportB.jasper", parameters, new JRTableModelDataSource(new

CustomTableModel()));

Unable to resolve this. please suggest.

 

 

 

 

 

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