Conditional Formating CrossTab
How could i do some conditional formating in a CrossTab.
When using the on FormatCell i can't reach the value printed in the cell,
when using OnGetValueText, and there formating the TppElement, all values
changes.
Any Suggestions ?
When using the on FormatCell i can't reach the value printed in the cell,
when using OnGetValueText, and there formating the TppElement, all values
changes.
Any Suggestions ?
This discussion has been closed.
Comments
If you do not want to affect all values, try checking the aColumn and aRow
parameters of the OnGetValueText event. This will allow you to only alter
certain cells and leave the others alone.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
var
dValue : Double;
begin
if (aRow > 1) and (aColumn > 2) then
if (aRow-2) mod 3 = 1 then
begin
if aColumn mod 4 = 0 then
begin
aElement.Color := clYellow;
aText := aText + '[' + IntToStr(aColumn mod 4) + ']';
end;
end
else if (aRow-2) mod 3 = 2 then
begin
CrossTab_Calc_2_Column_Values(CT_NetSales, aColumn, aRow, -2, -1, '/',
dValue);
aText := FormatFloat('###,##0.00', dValue);
end;
And i'm only seeing the [0] in some columns, but the complete line is in
yellow (or whatever color i choose).
Thanks for the code, however it is very difficult for me to test something
like this without an example of the crosstab you are using. If you trace
this code are the correct conditions firing at the right times? Is this
event firing only once per record?
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Every 4th column i'm seeing this [0] (coded) in the right column.
But, the Yellow is in every cell.
You should be able with any small crosstab to code this.
unless you change it back to it's original. Try doing something like the
following...
if aColumn mod 4 = 0 then
begin
aElement.Color := clYellow;
aText := aText + '[' + IntToStr(aColumn mod 4) + ']';
end
else
aElement.Color := clWhite;
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com