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

I don?t want print header group with no detail

edited March 2002 in General
Hi,

Delphi 5 Enterprise
Rep.builder 6.03

How can I disable printing header group when I haven?t detail?

My report detail is conditional.

Thanks in advance

Sergio Melchiori

Comments

  • edited March 2002
    When are you setting the detail band visibility? If the group header has
    already printed, then you are out of luck. The only way to fix this is to
    remove the draw commands associated with the header band, when the current
    page generation is complete. Create a TList. For each component in the
    group header band, use their OnDrawCommandCreate event to stick them inside
    of a TList. Then in the Report.OnEndPage event, you can loop through the
    TList and remove these draw commands from the page.

    ...
    var
    lPage: TppPage;

    begin
    ...
    lPage := Report.Engine.Page;

    for liIndex := 0 to myTList.Count - 1 do
    begin
    lDrawCommand := TppDrawCommand(myTList[liIndex]);
    lPage.RemoveDrawCommand(lDrawCommand);
    end;

    Cheers,

    Jim Bennett
    Digital Metaphors

This discussion has been closed.