Home RAP

Groups Totals in red when negative

Pretty much what the title says. I have a report with 3 groups (0, 1, 2) . On the header of each group I have DBCalc fields that sums up the values of each subgroup and i need their font color red when negatives. I've tried with the following two codes on the DBCalc "OnCalc" events but have not been succesful.

```
procedure DBCalc40OnCalc;
begin
if VENTAS['UTOTAL'] < 0 then
DBCalc40.font.color := clRed
else
DBCalc40.font.color := clBlack;
end;
```
and also tried this:

```
procedure DBCalc40OnCalc;
begin
if DBCalc.40.value < 0 then
DBCalc40.font.color := clRed
else
DBCalc40.font.color := clBlack;
end;
```
Thanks in advance.

Comments

Sign In or Register to comment.