Subreports with no content still have height

I have a report where a detail table needs to appear between separate content elements of its master, so I've implemented this as a subreport.

The works fine when the detail table does contain rows, but frequently the detail table is empty for a particular master row and when that happens I'd like the master content to "close up" and leave no gap where the subreport would otherwise be.

However, whatever I've tried the empty subreport always takes up some vertical space even when moved into its own child band with Stretched = True.

Is there a way of automatically making empty subreports vanish, or do I have to add an extra ChildBand.Visible check/assignment for the subreport's container in its OnBeforePrint?

Comments

  • edited 10:11PM
    Hello,

    You can control Subreport height in code section like below :

    Subreport1.Height:=0;

    You can use 'If Clause' in code section but you need an anchor point for example :

    if memo1.Text='' then Subreport1.Height:=0;

    Regards,
    boakoms
    Ian K wrote: »
    I have a report where a detail table needs to appear between separate content elements of its master, so I've implemented this as a subreport.

    The works fine when the detail table does contain rows, but frequently the detail table is empty for a particular master row and when that happens I'd like the master content to "close up" and leave no gap where the subreport would otherwise be.

    However, whatever I've tried the empty subreport always takes up some vertical space even when moved into its own child band with Stretched = True.

    Is there a way of automatically making empty subreports vanish, or do I have to add an extra ChildBand.Visible check/assignment for the subreport's container in its OnBeforePrint?
  • edited 10:11PM
    Thanks boakoms - that did the job!
    boakoms wrote: »
    Hello,

    You can control Subreport height in code section like below :

    Subreport1.Height:=0;

    You can use 'If Clause' in code section but you need an anchor point for example :

    if memo1.Text='' then Subreport1.Height:=0;

    Regards,
    boakoms

Leave a Comment