karthikij Posted May 19, 2008 Share Posted May 19, 2008 When I place my subreport in detail band of master report it gets repeated in master report.But if I place the same sub report in title band it displays only once.Can anyone please help me on this because it is urgent.Please tell me how to display sub report in detail band without repeatation. Link to comment Share on other sites More sharing options...
svntdeepak Posted May 20, 2008 Share Posted May 20, 2008 HiEven I am getting the same problem.When I run the sub repoort individually it is running properly but if i run that sub report along with the master report the detail band gets repeated.plz give me the solution. Thanks Deepak Link to comment Share on other sites More sharing options...
lucianc Posted May 20, 2008 Share Posted May 20, 2008 A report's detail band is rendered for each record in the data source that was passed to the report; this is what the detail band was meant to do. So if you put a subreport in the master report's detail band, it would obviously repeat for each record in the master's data source. If this is not what you wanted, then you haven't designed the report properly. I don't know what kind of solution one would be able to provide, since you're the only one who know how your report should look. If you want the subreport to appear only once, try putting it in the title or summary band. HTH,Lucian Link to comment Share on other sites More sharing options...
karthikij Posted May 20, 2008 Author Share Posted May 20, 2008 I tried in summary band it works fine.But problem in summary band is that page footer will not work for it.Hence placing an image(eg Reliance image in our project) comes immediately after the data instead coming at the footer.This causing huge problem because all pages have image at footer but last page in my case summary band image comes immediately after data.Please provide solution Link to comment Share on other sites More sharing options...
Meiren Posted May 21, 2008 Share Posted May 21, 2008 You can try to put this :"new Boolean($V{REPORT_COUNT}.intValue()==1)" In your subreport property print when expression, it will only print once your sub report in detail band, it worked for me. Link to comment Share on other sites More sharing options...
lucianc Posted May 21, 2008 Share Posted May 21, 2008 karthikij wrote:But problem in summary band is that page footer will not work for it.Please provide solution The solution for this case is already provided in the JasperReports documentation, see this FAQ. Regards,Lucian Link to comment Share on other sites More sharing options...
karthikij Posted May 24, 2008 Author Share Posted May 24, 2008 Hi This is just brilliant.Very good thinking.It works fine but it arised another problem where Iam getting so many empty pages after my subreport which has the condition new Boolean({$VReportCount}.intValue()==1).Please help me on this. Link to comment Share on other sites More sharing options...
bhanulakshmi Posted May 27, 2008 Share Posted May 27, 2008 Hi karthik, No yaar it is not working. Only once it is executing.I set the subreport to float. in java file i just add like this:idont know whether it is required or not. map.put("REPORT_COUNT",2);map.put("REPORT_COUNT",1);map.put("REPORT_COUNT",new Boolean(true));Everything i tried. not at all working. that means it is not getting repeated. See my problem is I have 6 sub reports in the main form.i want to execute 4,5,6 subreports only 3 times.1,2,3 sub reports let it be as it is. how can I design?I tried many ways yaar. Please help me. Link to comment Share on other sites More sharing options...
lucianc Posted May 27, 2008 Share Posted May 27, 2008 karthikij wrote:Since iam displaying only 2 of 10 fields in my upper subreport,my lower sub report is getting printed with huge gap after those two fields. Try to set isRemoveLineWhenBlank to true for the text fields. Regards,Lucian Link to comment Share on other sites More sharing options...
karthikij Posted May 28, 2008 Author Share Posted May 28, 2008 cool that is really cool.Please help me to give the final touches.Iam getting an empty page at the end of my report always.How to avoid.And also if have two group elements they are printing with the same left margin.How to make margin for first group fields to 5 and margin of second group fields to 0 because both use common fields.Hope i will get fast reply for this please Link to comment Share on other sites More sharing options...
karthikij Posted May 30, 2008 Author Share Posted May 30, 2008 Thing is you should not write this code in java.Open your ireport.In main report you might have added 6 reports.Right click that subreport.In print when expression of sub report just copy the following.new Boolean($V{REPORT_COUNT}.intValue==1).That means sub report will print only one time.if you want only one time compare to 1.if youw want two times compare to two.Thats it your problem over. Link to comment Share on other sites More sharing options...
byteryder Posted April 23, 2010 Share Posted April 23, 2010 I had the same problem, with a subreport repeating on every page. I had checked "print when detail overflows" for the subreport in the master report. When I unchecked it, the problem was solved. The idea of using a REPORT-COUNT == 1 is good if you are only going to print the detail band once. If you are going to repeat the detail (which happens in my report), then this doesn't work. Link to comment Share on other sites More sharing options...
mnj.ktr123 Posted September 9, 2017 Share Posted September 9, 2017 make sub reports separately ,use the same parameteras ,for each & every ....make a home report with the same connection.....use a "select * from" any table and "set limit 1" fro the query.....do not use any fields in DETAIL sector.....drag sub report element and set existing.......... 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