Skip to Content
0
Former Member
Jul 18, 2008 at 01:51 PM

How to dynamically change the text of a TextObject with embedded DataField?

1456 Views

Hi

I'm trying to dynamically change the text of a TextObject at runtime, by using the .NET library. My problem is that if one or more DatabaseFieldDefinition is embedded inside my text, I'm unable to change the "static text" only, by keeping the field, e.g. I have :

Text1 => "Contact Name: {Contact.Name}"

and I'd like to change it to anything else like:

Text1 => "Nom du Contact: {Contact.Name}"

Half of my TextObject is static text while second part comes from the dataset.

(of course the translation is dynamic - it is called at run-time and the new value to be set depends on the calling application language)

If I simply modify the Text property of my TextObject, the {Contact.Name} embedded field is not evaluated anymore by the Crystal Engine, but considered as a single text.

Using formulas or parameters looks quite difficult, because it means having many ones just for translation needs - I cannot control the way my users will create their reports and "force them" to use complex methods just in order to put a text and a value together...

Anyone knows how to deal with that ?