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

How to set the font...

edited May 2002 in General
Hi,

How to set the font of the entire report in run-time (without loop)?

Thanks,

Thiago

Comments

  • 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

This discussion has been closed.