Multi line data is displayed in single line in rich text box

A

Amit

Hi,
I have one application developed in Microsoft Office Infopath 2003.
In application, users can navigate between views. Data in view is saved in
database in xml format on Next button click by calling the web service from
Jscript.

When user clicks the Prev button or opens then form next time, I am
populating rich text box by retrieving the xml saved in database.

Problem: Multi line data is displayed in single line in rich text box, after
retrieving data from database.
Same data (multi line) is displayed properly, if I use the Text Box instead
of Rich Text Box.

Note: I have given all available formatting in Rich Text Box Properties
(Paragraph breaks, Character Formatting, Full Rich Text and Wrap Text).
I kept the break point in Jscript by using ‘debugger;’ statement and checked
the XDocument.DOM.xml after assigning the value retrieved from database to
Rich Text Box and there also multiline data is coming properly. But when data
is displayed in form’s view in rich text box, all enter characters are lost
and multi line data is displayed in single line.

Regards,
Amit.
 
F

Franck Dauché

Hi,

You may want to look into appendChild to add lines in your Rich Text Box.

Regards,

Franck Dauché
 
A

Amit

Thanks for quick response.

In fact, when we just navigate between views and do not retrieve the data
from database for rich text box, then multi line data is preserved in rich
text box.
But at that time, it adds “<div xmlns=\"http://www.w3.org/1999/xhtml\">
</div>†for all line breaks and all data is stored between “<div
xmlns=\"http://www.w3.org/1999/xhtml\">†and “</div>†tags. You can check
this by viewing the XDocument.DOM.xml in debug mode.

I tried to give data as mentioned above to rich text box but then “<div
xmlns=\"http://www.w3.org/1999/xhtml\">†and “</div>†tags are also displayed
in rich text box.

For time being, I will go ahead with text box instead of rich text box.

Regards,
Amit.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top