Generating Report with Groups from C++

edited October 2011 in FastReport 4.0
Trying to generate a report from c++.
I am trying to group some ids from the company name in my report.
Here is my code:


GroupHeader= new TfrxGroupHeader(Page);
GroupHeader->CreateUniqueName();
GroupHeader->Top =600;
GroupHeader->Height =20;
GroupHeader->Condition="'frxDBDataset1.\"company\"'";

MasterData = new TfrxMasterData(Page);
MasterData->CreateUniqueName();
MasterData->DataSet = frxDBDataset1;
MasterData->Top = 620;
MasterData->Height = 20;

Memo2 = new TfrxMemoView(GroupHeader);
Memo2->CreateUniqueName();
Memo2->DataSet = frxDBDataset1;
Memo2->DataField = "company";
Memo2->Parent = GroupHeader;
Memo2->Color = clGreen;
Memo2->HAlign = haLeft;

Memo = new TfrxMemoView(MasterData);
Memo->CreateUniqueName();
Memo->DataSet = frxDBDataset1;
Memo->DataField = "id";
Memo->SetBounds(200, 0, 100, 20);
Memo->HAlign = haLeft;
Memo->Color = clYellow;

It shows the TfrxMasterData, the problem is that it doesn't generate the header.

Comments

  • gpigpi
    edited 7:52PM
    What script language do you use in report?
  • edited 7:52PM
    gpi wrote: »
    What script language do you use in report?

    c++ script.
  • gpigpi
    edited 7:52PM
    Try
    GroupHeader->Condition="frxDBDataset1.\"company\"";
    and add
    Memo2->SetBounds(200, 0, 100, 20);
  • edited 7:52PM
    gpi wrote: »
    Try
    GroupHeader->Condition="frxDBDataset1.\"company\"";
    and add
    Memo2->SetBounds(200, 0, 100, 20);

    I have tried : GroupHeader->Condition="frxDBDataset1.\"company\""; and it doesn't work; It says: GroupHeader1:error in expression 'frxDBDataset1."company"': identifier expected.
    I also tried: GroupHeader->Condition="<frxDBDataset1.\"company\">"; and it gives the error : Unknown variable or datafield: frxDBDataset1."company"'.

    Thanks.

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.