Howzit, Using RB 10 with Delphi 7. I'm trying to change a cell's colour in a cross tab, based on the cell's value. Trying to do this using RAP. Regards, Gilbert
Run RBuilder\Demos\Crosstabs\Demo.dpr and cehck out ct126.pas, it contains an example of formatting cell color. I was able to use the same code in RAP. The example uses the Crosstab.OnFormatCell event and the following code to alternate cell color from whilte to silver
procedure CrossTab1OnFormatCell(aElement: TppElement; aColumn: Integer; aRow: Integer); begin if (aRow > 0) and (aColumn > 0) and ((aColumn mod 2) = 0) then aElement.Color := clSilver else aElement.Color := clWhite;
end;
Best regards,
Nard Moseley Digital Metaphors www.digital-metaphors.com
Comments
Run RBuilder\Demos\Crosstabs\Demo.dpr and cehck out ct126.pas, it contains
an example of formatting cell color. I was able to use the same code in RAP.
The example uses the Crosstab.OnFormatCell event and the following code to
alternate cell color from whilte to silver
procedure CrossTab1OnFormatCell(aElement: TppElement; aColumn: Integer;
aRow: Integer);
begin
if (aRow > 0) and (aColumn > 0) and ((aColumn mod 2) = 0) then
aElement.Color := clSilver
else
aElement.Color := clWhite;
end;
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com
indeces?
- In Delphi code you can reference Crosstab.Matrix.Value[aColumn, aRow].
- For RAP code you will to write a pass thru function.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com