How to loop through all controls with subreports
I want to loop through all the controls on my report setting font colour. I
have tried the code from the tip:
for liBand := 0 to aReport.BandCount-1 do
for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do begin
lObject := aReport.Bands[liBand].Objects[liObject];
if lObject.HasFont then
lObject.Font.color := clRed;
end;
But this does not include any controls within subreports.
How do I really loop through *all* the controls including those on
subreports??
Sarah
have tried the code from the tip:
for liBand := 0 to aReport.BandCount-1 do
for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do begin
lObject := aReport.Bands[liBand].Objects[liObject];
if lObject.HasFont then
lObject.Font.color := clRed;
end;
But this does not include any controls within subreports.
How do I really loop through *all* the controls including those on
subreports??
Sarah
This discussion has been closed.
Comments
components.
procedure UpdateReportFonts(aReport: TppCustomReport)
var
...
begin
for liBand := 0 to aReport.BandCount-1 do
for liObject := 0 to aReport.Bands[liBand].ObjectCount-1 do
begin
lObject := aReport.Bands[liBand].Objects[liObject];
=> if (lObject is TppSubreport) then
=> UpdateReportFonts(TppSubreport(lObject).Report);
else if lObject.HasFont then
lObject.Font.color := clRed;
end;
end;
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com
Report" tip
Sarah