You can manually edit the RTF text using the SelText property of the TppRichText object. Also if these values can be retrieved from your database, you might want to take a look at the Mail Merge feature. There are examples of this in the main reporting demo application located in the \RBuilder\Demos\1. Reports\... directory.
Take a look at Demo 29 located in the \RBuilder\Demos\1. Reports\... directory. This demo shows how to use the various RichText routines to manually alter your richtext text. I also suggest reading over the RBuilder help on these routines and properties as well as the Delphi TRichEdit topics as well.
Hello Nico, thanks for your help, but, I look that demo, and I don't find anything about to replace a string into RichText... I found only to change Attributes... I try: ppRichText1.SelectAll; StringReplace(ppRichText1.SelText, ':ano:', Ano, [rfReplaceAll]); StringReplace(ppRichText1.SelText, ':serie:', Serie, [rfReplaceAll]);
but, nothing... the ppRichText1.SelText is now returning my strings in RichText.. but the StringReplace doesnt work... maybe ppRichText1.SelText is set to ReadOnly...
Sorry, I for some reason thought you needed to change the format of the RTF document. If you just want to change the text shown, all you need to do is alter the TppRichText.RichText property. I also believe you are using the StringReplace function incorrectly. This is a function that receives a constant string and returns the altered string. Something like the following would probably work form the TppRichText.OnPrint event...
ppRichText1.RichText := StringReplace(ppRichText1.RichText, ':ano:', Ano, [rfReplaceAll]);
Comments
You can manually edit the RTF text using the SelText property of the
TppRichText object. Also if these values can be retrieved from your
database, you might want to take a look at the Mail Merge feature. There
are examples of this in the main reporting demo application located in the
\RBuilder\Demos\1. Reports\... directory.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
I try:
StringReplace(ppRichText2.SelText, ':ano:', Ano, [rfReplaceAll]);
but my ppRichText2.SelText show me nothing.... empty... I try
ppRichText2.Text, and show me RichText2... how I get the text into RichText?
Thanks for all.
Fellipe H.
Take a look at Demo 29 located in the \RBuilder\Demos\1. Reports\...
directory. This demo shows how to use the various RichText routines to
manually alter your richtext text. I also suggest reading over the RBuilder
help on these routines and properties as well as the Delphi TRichEdit topics
as well.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
thanks for your help, but, I look that demo, and I don't find anything about
to replace a string into RichText... I found only to change Attributes...
I try:
ppRichText1.SelectAll;
StringReplace(ppRichText1.SelText, ':ano:', Ano, [rfReplaceAll]);
StringReplace(ppRichText1.SelText, ':serie:', Serie, [rfReplaceAll]);
but, nothing... the ppRichText1.SelText is now returning my strings in
RichText.. but the StringReplace doesnt work... maybe ppRichText1.SelText is
set to ReadOnly...
thanks for all
Fellipe H
Sorry, I for some reason thought you needed to change the format of the RTF
document. If you just want to change the text shown, all you need to do is
alter the TppRichText.RichText property. I also believe you are using the
StringReplace function incorrectly. This is a function that receives a
constant string and returns the altered string. Something like the
following would probably work form the TppRichText.OnPrint event...
ppRichText1.RichText := StringReplace(ppRichText1.RichText, ':ano:', Ano,
[rfReplaceAll]);
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com