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

Hide Group Header if no records left

edited January 2004 in Subreports
Hi,

I have the following configuration: master and detail tables, two data
pipelines, report for master table and subreport for detail table.

Master records are printed in Header band. Detail records are printed in
subreport's detail section. Captions for detail records are printed in
Group Header band and are reprinted on each page. It is possible sometimes
that all the detail records fit one page and group footer prints on the next
page. Is it possible to hide Group Header if only Group Footer is printed
on the page (with no detail records)?

Thanks in advance.

Comments

  • edited January 2004
    Try this:

    1. Create a summary query that contains a count of the number of detail
    records for each master. Use this query as the master query for the main
    report.

    2. Use a TppVariable in the detail band to count the records for each
    group. Configure the Variable to reset when the group breaks.

    3. In the GroupHeaderBand.BeforePrint code

    if Report.Groups[0].FirstPage then
    GroupHeaderBand1.Visible := True
    else
    GroupHeaderBand1.Visible := varRecordCount < myPipeline['DetailCount']
    --
    Nard Moseley
    Digital Metaphors
    http://www.digital-metaphors.com


    Best regards,

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