Changing text of a Memo object

Hi all,

I've only just started with Fast Reports and while I've managed to work most things out I'm struggling with something really simple.

I need to be able to change the text of a memo object with code before displaying the report. The object is created using the designer but I cannot seem to change the text. I've seen Delphi examples but I'm using C++ Builder and having altered the code for that nothing seems to happen. I suspect I am not identifying the object correctly but am unsure quite what is wrong.

My code is

TfrxMemoView *pText = NULL;

pText = new TfrxMemoView(frxReport1->FindObject("Memo1"));

pText->Text = "New Text";

Any thoughts on what I am doing wrong would be greatly appreciated.

Comments

  • LurkingKiwiLurkingKiwi Wellington, New Zealand
    edited 10:48PM
    pText = new TfrxMemoView(frxReport1->FindObject("Memo1"));

    I'm not a C++ programmer, but from a C perspective, I'd try a cast rather than a new:
    pText = (TfrxMemoView)(frxReport1->FindObject("Memo1"));
  • TfrxMemoView * pText =

    dynamic_cast <TfrxMemoView *> (frxReport1->FindObject("Memo1"));

    pText->Text = (L"New Text");

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.