CrossView
BJL
Brussels, Belgium
When using CrossView, is there an equivalent to Line MOD 2 to get odd rows highlighted?
BJL
BJL
Comments
if rowindex mod 2 = 0 then memo.color := claqua else memo.color := clwhite;
Is it possible to extend the higlight to the RowHeader (the 2 first fields of the dataset, in my case)?
BJL
yes you can.
procedure Cross1OnPrintRowHeader(Memo: TfrxMemoView; HeaderIndexes, HeaderValues, Value: Variant);
begin
if HeaderIndexes[0] mod 2 = 0 then memo.color := claqua else memo.color := clwhite;
end;
i suppose if either of us read the user manual chapter on crosstabs we would have seen it sooner.
procedure Cross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin
if not Cross1.IsGrandTotalRow(rowindex) then
if rowindex mod 2 = 0 then memo.color := claqua else memo.color := clwhite;
end;
procedure Cross1OnPrintRowHeader(Memo: TfrxMemoView; HeaderIndexes, HeaderValues, Value: Variant);
begin
if (VarToStr(Value)<>'Grand Total') then
begin
if HeaderIndexes[0] mod 2 = 0 then memo.color := claqua else memo.color := clwhite;
end
else
memo.color := clyellow;
end;