pals169 Posted May 11, 2009 Share Posted May 11, 2009 Hello All,I Have issue with displaying 2 subreports in one master report. problem is that both the sub-report should print one after another.but it is not happening. It willl print first line of one subreport and after that it will print first line of second report. and it will print whole report in this manner. Attached here the file for that Link to comment Share on other sites More sharing options...
tomsimmons Posted May 11, 2009 Share Posted May 11, 2009 I think people will need the .jrxml files to understand what's going on. I'll have a look when you've posted them, this sounds like an problem I had some time back and managed to solve. Tom Link to comment Share on other sites More sharing options...
jmartens Posted May 11, 2009 Share Posted May 11, 2009 You need to have the subreports Position Type set to "float", not "fixed relative to top" Link to comment Share on other sites More sharing options...
pals169 Posted May 13, 2009 Author Share Posted May 13, 2009 Sorry for not attacching jrxml file. Here is my jrxml file. Link to comment Share on other sites More sharing options...
pals169 Posted May 13, 2009 Author Share Posted May 13, 2009 Thanks sooooooooooooooo much jmartens..... that issue has been solved :) but i have another issue can you please help me I have now one subreport inside another subreport. when i try to generate pdf from that it throws exception that "could not load object from jasper file " can you please help me in that ..I am waiting for your valuable inputs here patientNoteFinal is master report.historyQuestTab.jrxml is the sub-report that is to be included in master report.historyQuestGrp.jrxml is to be included in historyQuestTab.jrxml as a subreport.historyQuest.jrxml is to be included in historyQuestGrp..jrxml as a subreport. Could u pls look into these attached file and please let me know where i am going wrong. Link to comment Share on other sites More sharing options...
andfedotov Posted May 13, 2009 Share Posted May 13, 2009 What you need is to compile all you subreports before filling your mastr report.You can do it by clicking on preview button - we are expecting a compile button in the next version.I've succeeded running you reportPost Edited by andfedotov at 13/05/2009 04:48 PM Link to comment Share on other sites More sharing options...
pals169 Posted May 14, 2009 Author Share Posted May 14, 2009 Hi andfedotov,Kindly Explain the steps u have performed to run the above reports that i have sent . bcoz i have complied all my files and try to run but i found this error "net.sf.jasperreports.engine.JRRuntimeException: net.sf.jasperreports.engine.JRException: Could not load object from location : .\historyQuestGrp.jasper". Your help is precious to me .Waiting for your guidence. Link to comment Share on other sites More sharing options...
andfedotov Posted May 14, 2009 Share Posted May 14, 2009 Do you see file historyQuestGrp.jasper in your reports folder?If not - open historyQuestGrp.jrxml and do preview Link to comment Share on other sites More sharing options...
jmartens Posted May 16, 2009 Share Posted May 16, 2009 I assume your reports are working fine when you just have a single level of subreports. I'm also assuming that you're trying to run these in an application and you're passing in the SUBREPORT_DIR parameter to your top-level report. What's happening is when your first level of subreport wants to load the second-level subreport it is looking for it at $P{SUBREPORT_DIR}+"whatever.jasper" and it's using the default value of SUBREPORT_DIR (which is ".\\"). What you need to do is have your top-level report explicitly pass its value of SUBREPORT_DIR down to the first level subreport, so it has it available for when it needs to load the 2nd level subreport. I made the same mistake the first time I did nested subreports. Link to comment Share on other sites More sharing options...
pals169 Posted June 9, 2009 Author Share Posted June 9, 2009 Can u suggest how that can be done ??? how can i pass that parameter to second level subreport ...pls waiting for ur reply ?? Link to comment Share on other sites More sharing options...
jmartens Posted August 7, 2009 Share Posted August 7, 2009 Sorry. I haven't checked the forum in a while - working on another project.In your top-level report, right click on the subreport element and bring up the Properties window. Go to the "Subreport (other)" tab and at the bottom it shows the "subreport parameters". Click the "ADD" button to add a new parameter. The "name" is the name of the parameter expected by the subreport (e.g. "SUBREPORT_DIR"), and the expression is where to get the value from the main report (e.g. $P{SUBREPORT_DIR} )Hope that helps. (You'd probably figured it out already).James 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