Display RTF from secondary datasource - InfoPath Dev
in

InfoPath Dev

Display RTF from secondary datasource

Last post 09-20-2013 02:42 AM by Graeme. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 09-19-2013 07:12 AM

    Display RTF from secondary datasource

    I followed the discussion here and changed my data source xsd file to convince Infopath that my field is XHTML and not a string. I can then bind it to a rich text box, but I see all the html markup as text in the box.  I tried adding the  namespace to the root element, but it makes no difference. 

    My data source is simply returning this:

    <div xmlns="http://www.w3.org/1999/xhtml"> <b>Bold</b> </div>  

    What am I missing?

  • 09-20-2013 02:42 AM In reply to

    Re: Display RTF from secondary datasource

    I got this working by having a rich text box bound to an HTML field in the main data source by using this code on form load:

    string s = DataSources["REST Web Service"].CreateNavigator().SelectSingleNode("/ns1:ArrayOfRisk/ns1:Risk/ns1:Details", NamespaceManager).Value;
    MainDataSource.CreateNavigator().SelectSingleNode("/my:myFields/my:field1", NamespaceManager).AppendChild(s);

    But it is annoying having to have a redundant field in my main data source. If anyone knows a better way, I'd be most grateful.

    Thanks

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.