Creating Report At Runtime (C++ Builder)
Hi,
I'm trying to create a report (well, add some fields to a report) at runtime through C++ Builder but the following doesn't seem to work; is there something else I need to be doing?
frxLabel = new TfrxMemoView (((TfrxPageHeader*)frxApplicationList->FindObject("PageHeader1")));
frxLabel->Parent = ((TfrxPageHeader*)frxApplicationList->FindObject("PageHeader1"));
frxLabel->CreateUniqueName();
frxLabel->Top = 4.6;
frxLabel->Left = 10;
frxLabel->Height = 20;
frxLabel->Visible=true;
frxLabel->Memo->Text="123123123";
The label just doesn't appear!!
ALSO, do I need to delete frxLabel afther the report has displayed or does FastReport handle this for me?
Thanks,
Andy
I'm trying to create a report (well, add some fields to a report) at runtime through C++ Builder but the following doesn't seem to work; is there something else I need to be doing?
frxLabel = new TfrxMemoView (((TfrxPageHeader*)frxApplicationList->FindObject("PageHeader1")));
frxLabel->Parent = ((TfrxPageHeader*)frxApplicationList->FindObject("PageHeader1"));
frxLabel->CreateUniqueName();
frxLabel->Top = 4.6;
frxLabel->Left = 10;
frxLabel->Height = 20;
frxLabel->Visible=true;
frxLabel->Memo->Text="123123123";
The label just doesn't appear!!
ALSO, do I need to delete frxLabel afther the report has displayed or does FastReport handle this for me?
Thanks,
Andy
Comments
Sods law : "add a question to a newsgroup and then 10 minutes later you will sort it out yourself"
I also needed to add,
frxLabel->Width=...;
and multiply the values out using the pre-declared "fr1cm" so,
frxLabel = new TfrxMemoView (((TfrxPageHeader*)frxApplicationList->FindObject("PageHeader1")));
frxLabel->CreateUniqueName();
frxLabel->Top = 4.6 * fr1cm;
frxLabel->Left = nLeft;
frxLabel->Width = 4 * fr1cm;
frxLabel->Height = 2 * fr1cm;
frxLabel->Memo->Text="123123";
frxLabel->Visible=true;
Works for me!
Andy