theshreyas Posted July 12, 2012 Share Posted July 12, 2012 Hi.. i have passed the JrBeanCollectionDatasourse from my java program to the ireport..(.jasper file)please tell me the steps i need to do in ireport for receiving this object and displaying the values in pdf.again i hav embedded the subreport in the summary of main report. please help me out for displaying the values in sub report also.I have fetched the data from two tables and saved in two beans. one bean(energy_calibration) for master report and 2nd bean(shape_calibration) for subreportplease mention the steps i need to do for this in ireport. including the use of parametersthe java code i m used is:- Code: Post Edited by shreyas260989 at 07/12/2012 08:47Post Edited by shreyas260989 at 07/12/2012 08:55 Link to comment Share on other sites More sharing options...
theshreyas Posted July 12, 2012 Author Share Posted July 12, 2012 Guys please help me out.. waiting for ur ideas n creativity Link to comment Share on other sites More sharing options...
sanbez Posted July 13, 2012 Share Posted July 13, 2012 I did not understand the relationship between objects. Can you explain how relate objects of master report and subreport? See example of using subreport. May be this helps http://community.jaspersoft.com/questions/543298/creating-table-structure-assorted-java-bean-structure-one-field-and-list-datasource Link to comment Share on other sites More sharing options...
theshreyas Posted July 13, 2012 Author Share Posted July 13, 2012 for both main and subreport i am passing the parameters through main report.for Subreport i have created mapping for the individual parameter.and instead of conection i have passed JrBeanCollectionDatasourse in fillManager() method...I hope this information may answer your question. If you are still unclear with the information, you can ask again.. please refer the code i have attached and the two reports master(report2) and subreport(report3) .. waiting for the help.. thanks in advance.. Link to comment Share on other sites More sharing options...
sanbez Posted July 13, 2012 Share Posted July 13, 2012 Usual in master-detail report we have one master object (displayed in master report) and some childs of master object (displayed in subreport). It is clearly seen in the discussion threads on the link in my previous answer.Are you seen this? In your case subreport displayed only after all records of main report.This is what you wanted? Then pass Collection as parameter into main report and define DataSource expression for subreport, using this collection as parameter for method (for example createMyDataSource($P{mainReportParam}) ) which implements JRDataSource interface HTH Link to comment Share on other sites More sharing options...
theshreyas Posted July 16, 2012 Author Share Posted July 16, 2012 Hey.,, Finally I have done it..Actually datasourse was not going in subreport.. so i have changed the property of when no data to all sections,no data...then i have passed the collection variable where i have fetched the subreport records..by using parameters.put("shape_data_all",allShape_Caliberation);then i have created a parameter in main report.. and changed its class to java.Util.Collection..then in subreport property, connection type= Use a datasource expressionData Source Expression new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($P{shape_data_all})Then added the fields in the subreport same as i am having the bean properties..Thank you.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now