Mapping Rich Text data using DBXL v2.4 - Ernesto Machado
in

InfoPath Dev

Ernesto Machado

Mapping Rich Text data using DBXL v2.4

DBXL v2.4 has recently been updated to add “String(InnerXml)” and “String(OuterXml)” in the DAT database mapping dropdowns. This allows you to map rich text data into SQL.

  

 

  

We’ll illustrate the difference between InnerXml and OuterXml with two examples.

 

Example #1:

String(OuterXML) result: <my:Title><div><br/>InnerXML</div></my:Title>

String(InnerXML) result: <div><br/>InnerXML</div>

 

Example#2:

String(OuterXML) result:

<my:myFields xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-10-12T19:13:08" xml:lang="en-us">

  <my:Title>Title1</my:Title>

  <my:RichText1>

    <strong xmlns="http://www.w3.org/1999/xhtml">

      <font style="BACKGROUND-COLOR: #ffff00" color="#ff0000">Rich Text 1</font>

    </strong>

  </my:RichText1>

  <my:RichText2>Rich Text 2</my:RichText2>

</my:myFields>

 

String(InnerXML) result:

<my:Title xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-10-12T19:13:08">Title1</my:Title>

<my:RichText1 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-10-12T19:13:08">

  <strong xmlns="http://www.w3.org/1999/xhtml">

    <font style="BACKGROUND-COLOR: #ffff00" color="#ff0000">Rich Text 1</font>

  </strong>

</my:RichText1>

<my:RichText2 xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2010-10-12T19:13:08">Rich Text 2</my:RichText2>

Comments

 

JMdream said:

Will this work only for InfoPath Rich Text fields? What if I wanted to map a Text box to SQL. I originally set up the data type in SQL as nvChar(MAX) and it was mapped in DAT as String. Do I need to drop an recreate my sql tables or just change my data type in DAT to String(inner), or must I also now also edit my form and change all text boxes to Rich Text fields too and can I keep mty SQL tables as is?

January 18, 2011 8:28 AM
 

rgoel said:

Hi Ernesto,

Based on your explanation about mapping RTF into SQL.

How can we fetch rich text data from SQL which is in string inner xml form into Rich text box in Infopath 2007?

Suppose we have another Infopath form where I need to show the SQL data which is in string inner xml.

Please explain. It is urgent. We are analyzing the Qdabra2.4 trial software and we have requirement like this.

January 24, 2011 2:21 AM
 

ErnestoM said:

With code, it is a simple assignment of the richtext node to the string value returned from QueryDB (e.g. richTextNode.InnerXml = node.Value)

May 11, 2011 7:13 AM
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.