This is a migrated thread and some comments may be shown as answers.

Tes Value of Merge Field

5 Answers 53 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
pedrotti
Top achievements
Rank 1
pedrotti asked on 07 Jan 2013, 11:31 AM
Hello

Can someone tell me if it's possible to do this

If <<MergeFileld1>> = 'Test 1' then
   Show this section or Paragrah
Else
   Show this section or Paragrah

Thank you a lot and have a good programmatic Year 2013

Anne

5 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 09 Jan 2013, 03:53 PM
Hi Anne,

Genuine conditional fields are in our development plans, but have not been implemented yet.

However, it is possible to implement a custom field that will behave in a similar way using the TextBeforeIfNotEmpty and TextAfterIfNotEmpty properties of MergeFields. By default they are not added if the field value is empty string. In the attached sample implementation they are added if the value is not 0. Please find the project attached.

Let us know if you need additional assistance.

Greetings,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
pedrotti
Top achievements
Rank 1
answered on 18 Jan 2013, 01:10 PM
Hi Petya,

Could you send me a VB.NET version of your project ? I don't manage to convert it via your Code Converter.

Thank you,

Anne
0
Petya
Telerik team
answered on 18 Jan 2013, 04:48 PM
Hello Anne,

Please find the project converted to VB.NET as you requested.
 
Greetings,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
pedrotti
Top achievements
Rank 1
answered on 30 Jan 2013, 02:07 PM
Thank you the solution you provided to us work well.

Could you tell me how to keep carriage returns within TextAfterIfNotEmpty.

For instance :

{CUSTOMIFMERGEFIELD ForSou \b False \f "text :
 line1
line 2
line 3"}

When i merge the document i get this : text : line1line 2line 3

When i change Display mode to FieldDisplayMode.Code; i get :
{CUSTOMIFMERGEFIELD ForSou \b False \f "text : line1line 2line 3"}
It delete carriage return & line feed

Thank you for your help,

Anne.
0
Petya
Telerik team
answered on 04 Feb 2013, 09:17 AM
Hello Anne,

Unfortunately, the result you are trying to achieve is not possible with the current implementation. We have had similar requests in the past, however the feature has not been scheduled yet and I cannot tell if and when it will be implemented.

Let us know if you have other comments or questions.

Kind regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
pedrotti
Top achievements
Rank 1
Answers by
Petya
Telerik team
pedrotti
Top achievements
Rank 1
Share this question
or