Using variable placeholders in a memo component
Hello there; I have a project where the end user requires to be able to
define the content of a block of text whihc in turn can refer to certain
data fields which get included in the end text; a bit like the way that
format() works.
For instance the text value could be "Just think [subscribername], your name
could be on the list of [contestname] successful winners in [month]'s draw"
and the (calc) routine relevant to this could recognise the three column
names and make the correct substitutions. The important thing being that
the text could be defined on the fly by the user at runtime. The user
should be able to redefine the text at a future by, for example, adding an
address detail or a date.
Is there anything in RB which can help me here- a format() or
replacestring() routine which I'm failing to detect? I'm not looking to
pre-code this which would be the normal way of doing things - I want the end
user to define the code block and maybe store this in a datatable.
Any help would be massively appreciated:
Cheers, David
define the content of a block of text whihc in turn can refer to certain
data fields which get included in the end text; a bit like the way that
format() works.
For instance the text value could be "Just think [subscribername], your name
could be on the list of [contestname] successful winners in [month]'s draw"
and the (calc) routine relevant to this could recognise the three column
names and make the correct substitutions. The important thing being that
the text could be defined on the fly by the user at runtime. The user
should be able to redefine the text at a future by, for example, adding an
address detail or a date.
Is there anything in RB which can help me here- a format() or
replacestring() routine which I'm failing to detect? I'm not looking to
pre-code this which would be the normal way of doing things - I want the end
user to define the code block and maybe store this in a datatable.
Any help would be massively appreciated:
Cheers, David
This discussion has been closed.
Comments
Take a look at the MailMerge feature of the TppRichText component. This
will allow you to dynamically add data tags to your rich static rich text
that will change based on the data that is being traversed. If you would
like to manually control this data, you can try using a JITPipeline
connected to a StringList or some other object in Delphi. Take a look at
demo 28, located in the \RBuilder\Demos\1. Reports\... directory
(dm0028.pas) and see if this will work for you.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
description it sounds exactly what I'm after (typing with fingers crossed!)
cheers - David
up so I'm having trouble running demo 28 but managed to cobble something
together to create a small demonstration for my end user next week. Is
there any easy way I can "uncouple" the property editor so that I could use
this feature in another area of my project that you know of? I can do an
inherit on the form but I know that it needs extra work in working in the
components which refer to the table/query pipeline and available fields. I
think I need to try and repair the BDE setup and run the demo as well. Once
again thanks for you help on this.
Cheers - David
Unfortunately the property editor on the Rich Text dialog was not designed
to be a separate entity. It is however just a simple mix of panels and
TppTreeView objects for the most part and should not be too difficult to
recreate on your own. To see the code and objects used, take a look at the
ppRichEd.pas file in the RBuilder source.
--
Regards,
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
Nico Cizik
Digital Metaphors
http://www.digital-metaphors.com
which should help me demonstrate the behaviour I need. Thanks for your time
here - cheers, David