Comparing Values in CrossTabs
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
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
This discussion has been closed.
Comments
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
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
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