Generating Report with Groups from C++
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.
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
c++ script.
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.