CellFields, ColumnFields & RowFields
How Am I supposed to set the CellFields, ColumnFields and RowFields from code?
I tried DBCross1.ColumnFields.Strings.Text := ('<frxdbdsReport."nome">');
but it showed me an exception.
So I tried DBCross1.ColumnFields.Strings := ('<frxdbdsReport."nome">');
but it showed me also an exception
So I even tried DBCross1.ColumnFields.Strings := ('nome');
And it din't work as well.
Im in despair!! What should I do??
I tried DBCross1.ColumnFields.Strings.Text := ('<frxdbdsReport."nome">');
but it showed me an exception.
So I tried DBCross1.ColumnFields.Strings := ('<frxdbdsReport."nome">');
but it showed me also an exception
So I even tried DBCross1.ColumnFields.Strings := ('nome');
And it din't work as well.
Im in despair!! What should I do??
Comments
procedure Cross1OnBeforePrint(Sender: TfrxComponent);
begin
with Cross1 do
begin
AddValue(, [2001, 2], [1500]);
AddValue(, [2001, 3], [1600]);
AddValue(, [2002, 1], [1700]);
AddValue(, [2002, 1], [2000]);
AddValue(, [2001, 1], [4000]);
AddValue(, [2001, 2], [4100]);
end;
end;
procedure Cross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
var
mv:tfrxcustommemoview;
begin
if not Cross1.IsGrandTotalRow(rowindex) then
if rowindex mod 2 = 0 then memo.color := claqua else memo.color := clwhite;
if (cross1.isgrandtotalrow(rowindex)) and
(ColumnIndex >= 0) then
begin
memo.displayformat.kind := fkNumeric;
end;
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;
begin
end.
hope this helps
How Am I supposed to do in such way?
generally set the props from the obp of the object that contains the crosview or dbxcrosview
cellfields, rowfields columnfields are 0 based indexed list of tstrings.
here is an example of iterating through a bands object to find the object you want
then modify its props. just change to suit object you are seeking
var
i: Integer;
c: TObject;
for i := 0 to Sender.Objects.Count - 1 do
begin
c := Sender.Objects
if c is TfrxMemoView then
TfrxMemoView©.Visible := False
else if c is TfrxLineView then
TfrxLineView©.Visible := True
end;