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 5:38AM
    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 5:38AM
    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
    boakoms 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?

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.