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

Comparing Values in CrossTabs

edited February 2007 in RAP
Hi

I am using RB7.04 Enterprise and Delphi 7

I am wanting to compare the values in two columns of a crosstab and if one
of the values is lower than the other to highlight the cell(s). I am using
the following code to attempt this:

procedure CrossTab1OnFormatCell(AElement: TppElement; aColumn: Integer;
aRow: Integer)
begin
if (AColumn = 4) and
(CrossTab1.Matrix.Value[3,ARow] < CrossTab1.Matrix.Value[4,ARow])
then aElement.color := clRed;
end;


However I am getting the following error message:

Error: CrossTab1OnFormatCell, Line 4: Expected: '(' or '[', but found
'Value' instead.

Which I think is a spurious message.


First off is what I am trying to do possible and if so what am I doing
wrong.

Any help appreciated.

Regards

Tim Murfitt

Comments

  • edited February 2007
    Hi Tim,

    This should be possible however it looks like the TppMatrix properties are
    not natively available in RAP. One option would be to create a RAP passthru
    function to access the Matrix.Value property outside of RAP. See the
    developer's guide and the RAP demo for examples of creating RAP passthru
    functions.

    Another option may be to gather the values for these cells using the
    OnGetValueText event, and use them later when you need to check the values
    for a condition.

    --
    Regards,

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

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited February 2007
    Nick

    I created a RAP passthru function as you suggested and the report is now
    just as my client wanted it. Excellent news all round.

    Thank you very much.

    Regards

    Tim Murfitt


This discussion has been closed.