Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

RichText - RB 6.03

edited May 2003 in End User
Hello !
we are using an application developped with Delphi5 PRO and RB 6.02 or 6.03
?
We can edit the reports at runtime but it is not possible to change at
runtime the text of a TppRichText ?
Is that normal - is this possible with the RB 7.xx ?

Thanks.

Remy

Comments

  • edited May 2003
    I have 6.03 and i change the text of tppRichText.

    Abrito


  • edited May 2003
    You should be able to change the rich text? How are you changin it? In which
    event are you changing the rich text?

    There is an example of changing it in the installed RB demos. See the main
    reports demo project for report #29.

    Alternatively, here is an article on changing the rich text with the rich
    text from a TRichEdit:

    ------------------------------------------------
    Tech Tip: Copy RTF data from TRichEd to TppRichText
    ------------------------------------------------

    You can copy RTF data from Delphi's TRichEd to ReportBuilder's TppRichText
    control by using an intermediate memory stream:



    var
    lRTFStream: TMemoryStream;

    begin

    {create temp memory stream}
    lRTFStream := TMemoryStream.Create;

    {save the TRichEd's rtf data to the memory stream}
    RichEdit1.Lines.SaveToStream(lRTFStream);

    {load the rtf stream to the TppRichText}
    lRTFStream.position := 0;
    ppRichText1.LoadFromRTFStream(lRTFStream);

    {free the memory stream}
    lRTFStream.Free;


    end;


    Note: An alternative method would be to use RichEdit1.Lines.SaveToFile and
    TppRichText.LoadFromFile.



    --
    Tech Support mailto:support@digital-metaphors.com
    Digital Metaphors http://www.digital-metaphors.com




    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    Thanks a lot for you help !
    My problem is to edit at run time in the designer - some tpprichtext
    component established at design time.
    What I imagine is to double click on the rich text to obtain the rich text
    editor ... for make some modifications :)
    Is that possible ?

    Regards.

    Remy


  • edited May 2003
    Right click over the rich text control and choose Edit from the popup menu
    in the run time designer. It works in tests here using RB 7.02. Can you
    reproduce this with our ReportExplorer demo?


    Cheers,

    Jim Bennett
    Digital Metaphors


  • edited May 2003
    It doesn't for me - right click doesnt give any popup at run-time - I will
    ask my boss to upgrade because I see I'm still working with the 6.02 release
    :)

    Thanks again for your time!

    Remy

  • edited May 2003
    Try adding ppRichEd to your uses clause.


    Cheers,

    Jim Bennett
    Digital Metaphors


This discussion has been closed.