Jump to content
We've recently updated our Privacy Statement, available here ×

sub report gets repeated


karthikij

Recommended Posts

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

  • Replies 12
  • Created
  • Last Reply

Top Posters In This Topic

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

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

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

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

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

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

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

  • 1 year later...

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

  • 7 years later...

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

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