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??

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:28PM
    here are some samples from working within the report

    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
    ;)
  • edited 2:28PM
    That example is good for the TfrxCrossView, however I'm trying to do this eith the TfrxDBCrossView and I need to set the Cells, Columns and Rows from a DataSet.

    How Am I supposed to do in such way?
  • gordkgordk St.Catherines On. Canada.
    edited 2:28PM
    the first example was for the crossview the second was for the frxdbcrossview
    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;
    ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.