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

conditional format

edited May 2008 in General
would anyone know if it's at all possible to use conditional formatting
in a report?
for example, every date within a month of the current date should be red,
every date over a month but under two months orange and all the rest green.

thanks in advance :-)

kind regards,

M?lisande



--- posted by geoForum on http://delphi.newswhat.com

Comments

  • edited May 2008
    Hi Mélisande,

    You can use the report events to conditionally change a report component
    based on some information. For instance, inside the Band.BeforePrint event,
    you could add code to do the following...

    (Psuedo code)

    begin

    if Report.DataPipeline['DateField'] < (Now() + 30) then
    DBText.Font.Color := clRed;

    ...

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited May 2008
    heya,

    thanks for the quick response :-)
    could you help me out further though?
    I'm *very* new to report builder and know next to nothing about Delphi.
    Could you please tell me where I should put this??

    thanks! :-D

    kind regards,
    M?lisande







    --- posted by geoForum on http://delphi.newswhat.com
  • edited May 2008
    Melisande wrote:


    In your Report Designer, select the band that your fields are in..
    Then, in the Delphi Object Inspector, select the events tab.
    Double click in the space to the right of BeforePrint.

    HTH

    Arno

    --
This discussion has been closed.