Moving a shape component from one band to another at runtime
Hi,
I'm using a TppShape component to implement intermittent shading of all reportlines.
The shape is part of the report-design and has ParentHeight and ParentWdith
set to true.
At runtime all detail and groupfooterbands have a OnBeforePrint event which
calls SetBandShading if the band is visible.
procedure TRBHeaderFooterReport.SetBandShading(aBand: TppBand);
begin
inc(LineNrOnPage);
//Alternate background shading
if assigned(FShadingShape) then
if ((LineNrOnPage mod 2) = 0) then
begin
FShadingShape.Band := aBand;
FShadingShape.Visible := true;
end
else
FShadingShape.Visible := false;
end;{- .SetBandShading }
This seems to work for the detailband (where the shape is originally placed)
but somehow it doesnt work on the groupfooter band.
Should i do something more than set the Band property of the shape-component
to make it appear in the band?
greetings
Bas Schouten
I'm using a TppShape component to implement intermittent shading of all reportlines.
The shape is part of the report-design and has ParentHeight and ParentWdith
set to true.
At runtime all detail and groupfooterbands have a OnBeforePrint event which
calls SetBandShading if the band is visible.
procedure TRBHeaderFooterReport.SetBandShading(aBand: TppBand);
begin
inc(LineNrOnPage);
//Alternate background shading
if assigned(FShadingShape) then
if ((LineNrOnPage mod 2) = 0) then
begin
FShadingShape.Band := aBand;
FShadingShape.Visible := true;
end
else
FShadingShape.Visible := false;
end;{- .SetBandShading }
This seems to work for the detailband (where the shape is originally placed)
but somehow it doesnt work on the groupfooter band.
Should i do something more than set the Band property of the shape-component
to make it appear in the band?
greetings
Bas Schouten
This discussion has been closed.
Comments
I suggest using a different shape object for the GroupFooter Band. Once the
shape has been created for the detail band, (which is special because it has
the capability of creating multiple drawcommands for a single component) I
do not believe it is possible to simply "move" it to a different band.
Creating separate shapes and simply toggling the visiblity of each should
solve the issue.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thanks for the advice, i'll try it that way after the weekend :-)
gr
Bas