frxCrossView

BJLBJL Brussels, Belgium
edited 11:59PM in FastReport 3.0
FR3.04 and BCB6

As an example, I take the "PrintTable" demo which prints the table Customers.db using frxCrossView and filling it by code.

With Dimensions | Rows set to 0, there is no row header repeated.
If this value is set to 1, a row number is added and repeated on pages to the right.

How can I set the Cross object to recognize the first field (or the 2 first) to be the Row Header instead of getting a row number?

I have tried
for j := 0 to Table1.Fields.Count - 1 do
Cross.AddValue([Table1.Fields[0].AsString], [Table1.Fields[j].DisplayLabel], [Table1.Fields[j].AsString]);

Table1.Next;
and
Cross.RowLevels := 1;

but it does not work.

Thanks for helping.

BJL

Comments

  • BJLBJL Brussels, Belgium
    edited 11:59PM
    Setting Dimensions | Rows to 2 and nosubtotal for row1 and the following code brings a solution to my problem, except that the headers of the 2 first columns are missing.

    procedure TForm1.frxReport1BeforePrint(c: TfrxReportComponent);
    var
    Cross: TfrxCrossView;
    {i,} j: Integer;
    begin
    if c is TfrxCrossView then
    begin
    Cross := TfrxCrossView©;

    Table1.First;
    { i := 0;}
    while not Table1.Eof do
    begin
    for j := 2 to Table1.Fields.Count - 1 do
    Cross.AddValue([Table1.Fields[0].AsString, Table1.Fields[1].AsString],
    [Table1.Fields[j].DisplayLabel], [Table1.Fields[j].AsString]);

    Table1.Next;
    { Inc(i);}
    end;
    end;
    end;


    BJL

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.