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;
Comments
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
http://www.digital-metaphors.com
info@digital-metaphors.com