Creating Report At Runtime (C++ Builder)

edited November 2004 in FastReport 3.0
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

Comments

  • edited 11:20PM
    Sorry,

    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

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.