Toggle navigation
ReportBuilder Support Forums
Categories
Discussions
Activity
Sign In
Home
›
General
ReportBuilder 22.06 now available including Delphi 12.2 support!
New Blog Posts: Merging Reports -
Part 1
and
Part 2
How to set the font...
rbuser
May 2002
edited May 2002
in
General
Hi,
How to set the font of the entire report in run-time (without loop)?
Thanks,
Thiago
Comments
digitalmetaphors
May 2002
edited May 2002
You can't set the font of the entire report. You need to loop through the
objects in the report and set all the fonts individually:
procedure AssignFontToReport(aFont: TFont; aReport: TppCustomReport);
var
liBand: Integer;
liObject: Integer;
lObject: TppComponent;
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 := aFont;
end;
end;
--
Cheers,
Alexander Kramnik
Digital Metaphors
Digital Metaphors Corporation
http://www.digital-metaphors.com
info@digital-metaphors.com
This discussion has been closed.
Comments
objects in the report and set all the fonts individually:
procedure AssignFontToReport(aFont: TFont; aReport: TppCustomReport);
var
liBand: Integer;
liObject: Integer;
lObject: TppComponent;
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 := aFont;
end;
end;
--
Cheers,
Alexander Kramnik
Digital Metaphors
http://www.digital-metaphors.com
info@digital-metaphors.com