C1 Community
ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Field inline formatting charcters

rated by 0 users
This post has 5 Replies | 2 Followers

Top 500 Contributor
Posts 16
MarkPearl Posted: Mon, Jun 22 2009 3:31 AM

 Does anyone know if you can do inline formatting characters on fields.

 

The scenario I have is that I am creating a document, I need some of the text to be bold and the rest to be normal.

In htm I would do something like <B>Bold Text Here</B> Normal text here...

Can something similar like this be done to a field text string?

Top 500 Contributor
Posts 16
MarkPearl replied on Tue, Jun 23 2009 8:25 AM

Okay.. after some reading I found that you can enable RTF per field which would solve this issue, however when I set the RTF field to true and copy the sample code from the help it does not render as RTF, but as text???

 Does anyone have a working sample of RTF rendering per field so I can get this to work? Thanks.

Top 10 Contributor
Posts 1,237
Hi Mark,
 
With reference to your query I have created a sample application (attached with this email) for your which demonstrates how we can show RTF string in Field of C1WPFReport.
 
In your code the string you are showing is not properly formatted that is the reason it is not appearing as an RTF string.
 
The best way to know the correct RTF formatting of text is to use Windows WordPad utility. Write some text and apply some formatting on in and save the document as *.rtf and open that *.rtf document in notepad. You will get the entire RTF encoding of the text you have saved in the document and then assign that encoded text string to Text property of a Field in C1WpfReport.
 
PS: Before running the sample please put RTF_Report.xml file in C:\ on your machine (which you can find in the sample).
 
Hope this helps.
 
Have a nice day.
 
Regards,
Patrick Simpson
 
 

<MarkPearl> wrote in message news:219238@10.0.1.98...

Okay.. after some reading I found that you can enable RTF per field which would solve this issue, however when I set the RTF field to true and copy the sample code from the help it does not render as RTF, but as text???

 Does anyone have a working sample of RTF rendering per field so I can get this to work? Thanks.



http://helpcentral.componentone.com/cs/forums/p/79622/219238.aspx#219238

Top 500 Contributor
Posts 16
MarkPearl replied on Tue, Jun 30 2009 1:43 AM

Thanks Patrick... it works great!

Not Ranked
Posts 1
clintp replied on Thu, Jul 23 2009 12:24 PM

What if I want a rtf field to do say the following:

 Contract # 122001

but the number will not be hard coded in but rather the text from another form field?

Top 500 Contributor
Posts 16
MarkPearl replied on Thu, Jul 23 2009 11:29 PM

You would need to create the RTF string dynamically.

 Simplest way would be to first create the RTF text string statically, then look in the RTF string where the actual number 122001 is, remove that value from the string and place a variable of type string in its place by concatenating the original RTF string with your variable string.

That way the underline text would be dynamic but still have the "underline" formatting applied to it.

Page 1 of 1 (6 items) | RSS
Contact ComponentOne: 1.800.858.2739 ©1987-2009 ComponentOne LLC All Rights Reserved.