Online Documentation for Advanced Excel Report for RAD Studio
OnFormatCell event - Example
procedure TReportContainer.FormatProFormatCell(Sender: TObject;
Band: TEXLReportBand; RowInTemplate, RowInReport, ColumnInReport: Integer;
Report: _Worksheet; const CellValue: OleVariant);
var
R1, R2: String;
begin
if (Band.BandType = xlrbtMasterData) and (ColumnInReport = 4) then
begin
R1 := 'A' + IntToStr(RowInReport);
R2 := 'D' + IntToStr(RowInReport);
if CellValue >= 45000 then
begin
Report.Range[R2, R2].Font.Color := clRed;
Report.Range[R2, R2].Font.Bold := True;
end
else if CellValue <= 20000 then
begin
Report.Range[R1, R2].Font.Color := clWhite;
Report.Range[R1, R2].Interior.Color := clRed;
end;
end;
end;