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

Reports with lines - color yes, color not

edited December 2003 in General
How I make to create the effect "color yes", "color not" in the reports?

Tks

****************************************************************************
Alison Ramos Lacerda
Departamento de Neg?cios / Divis?o de Suporte a Clientes / Departamento de
Desenvolvimento
DoubleSoft An?lise, Projetos e Sistemas Informatizados S/C Ltda.
FONE : +55 11 4538-1872

"IMPLEMENTANDO SOLU??ES ?S SUAS NECESSIDADES"
Visite nosso Site: www.doublesoft.com.br

Comments

  • edited December 2003
    Hi Alison,

    Your best approach to this would be to use a Report Object Loop to access
    every component in your report, then depending on if the object is a line or
    not, set the color of that line. Below is a quick example of what you might
    do...

    uses
    Graphics,
    ppClass;

    procedure AssignColorToLines(aColor: TColor; 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 TppLine then
    lObject.Color := aColor;

    end;

    end;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.