create crosstab from code

Hi ...
i try this...

procedure TForm1.Button1Click(Sender: TObject);
var kros:TfrxDBCrossView;
begin
kros:=TfrxDBCrossView(frxreport1.FindObject('Dbcross1'));
kros.CreateUniqueName;
kros.SetBounds(50,100,60,30);
kros.ColumnFields.Add('field1');
kros.ColumnLevels := 1;
kros.RowFields.Add('field2');
kros.RowLevels := 1;
kros.CellFields.Add('field3');
kros.CellLevels := 1;
kros.Dataset :=frxDBDataset1;
frxReport1.ShowReport(true);
end;

how to disable subtotal on field1 ?
how to change caption of field1 ?

tks

Comments

  • gpigpi
    edited 9:49PM
    Use
    var kros:TfrxDBCrossView;
    begin
    kros:=TfrxDBCrossView(frxreport1.FindObject('Dbcross1'));
    kros.SetBounds(50,100,60,30);
    kros.ColumnFields.Add('Year');
    kros.ColumnFields.Add('Month');
    kros.CornerMemos[1].Text:='Test';
    kros.ColumnLevels := 2;
    kros.ColumnTotalMemos[1].Visible:=False;
    kros.RowFields.Add('Name');
    kros.RowLevels := 1;
    kros.CellFields.Add('Salary');
    kros.CellLevels := 1;
    kros.Dataset :=frxDBDataset1;
    frxReport1.ShowReport();
    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.