Home Subreports
New Blog Posts: Merging Reports - Part 1 and Part 2

Hide Band if no visible lines in subreport

edited December 2003 in Subreports
Hello all
I would like to know how its possible to hide the detail band in the main
report if there is no visible lines in the subreport (I'm hiding the lines
at runtime).

thanks in advance
zjetie

Comments

  • edited December 2003

    You need to use the main report's DetailBand.BeforePrint event to set the
    DetailBand.Visible property. For a master/detail report you can check the
    detail datapipeline to determine whether there are any related records for
    the current master:

    if myDetailPipeline.Bof and myDetailPipeline.Eof then
    myReport.DetailBand.Visible := False // no detail records
    else
    myReport.DetailBand.Visible := True


    --
    Nard Moseley
    Digital Metaphors Corporation
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
  • edited December 2003
    The problem is that there are records in the detail pipeline but im hiding
    it because it does not meet the criteria to be shown and i need it in the
    pipeline because of the calculations

  • edited December 2003

    I think you still need to use the main report's DetailBand.BeforePrint event
    to set the DetailBand.Visible property. Perhaps you can create a summary
    query to perform some of the calculations.

    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com

    Best regards,

    Nard Moseley
    Digital Metaphors
    www.digital-metaphors.com
This discussion has been closed.