How create RichtextBox use Webservice datasource - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How create RichtextBox use Webservice datasource

Last post 11-19-2005 04:16 AM by AndersR. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 11-17-2005 12:32 AM

    • m2land
    • Not Ranked
    • Joined on 10-18-2005
    • China
    • Posts 9

    How create RichtextBox use Webservice datasource

    I wrote a Webservice for SQL database, and use that Webservice as the datasoure of an InfoPath sheet.
    There are some NVChar fields in SQL database tables, I want map those NVChar fields to Richtext box controllers. But I found all TYPE of those NVChar field are "string" in Infopath, I can not change the type becasue "Data Type" choose field in properity dialog is gray.
    I can manually extract the schema file from XSN file and change "string" type to "XHTML" type that Richtext Box need, But I don't think it's a clever solution.

    Appreciations for your reply!
  • 11-17-2005 05:03 AM In reply to

    Re: How create RichtextBox use Webservice datasource

    When you hooked you InfoPath form into the webservice, InfoPath inferred the schema from your webservice.

    Two options come to my mind.

    1 - Have the webservice return a strongly typed dataset and I believe InfoPath will use the schema defined in the dataset (I am assume you are passing through a dataset from your webservice to InfoPath).
    2 - Go to File >> Extract and modify the schema as you mentioned. It is a perfectly fine solution.

    The advantage of the first is more from a logical point of view. The webservice could be considered a publisher of the data. Thus it would make most sense that it would define its data rather than having applications like InfoPath infer a schema from it. Plus if the webservice is used in other applications or InfoPath forms, you will only have a single maintenance point (recognizing that you will still have to refresh InfoPath with the webservice if you make changes to the schema defined in the webservice).

    Schema management becomes really important when you start jumping into the relm of integrating InfoPath and BizTalk.
    Jason
    http://www.k2distillery.com/
  • 11-17-2005 06:38 PM In reply to

    • m2land
    • Not Ranked
    • Joined on 10-18-2005
    • China
    • Posts 9

    Re: How create RichtextBox use Webservice datasource

    Many thanks for your help! I will try to use the first solution because it's so hard to keep synchronicity between Infopath and SQL database design if use second solution.I am not clear about how to define a strongly typed dataset in Webservice(especially for XHTML type), is there any exapmle about it?
  • 11-18-2005 12:49 AM In reply to

    Re: How create RichtextBox use Webservice datasource

    I can recommend viewing this webcast about ADO.NET dataset support

    http://msevents.microsoft.com/cui/WebCastEventDetails.aspx?culture=en-us&EventID=1032259551&CountryCode=US

    Also be sure to check out these 3 excellent articles from in MSDN library on the subject:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/office_infopath_using_datasets.asp

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/OfficeInfoPathWebServiceASPNET.asp?frame=true#officeinfopathwebserviceaspnet_section1

    http://msdn.microsoft.com/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_09.asp

    A strongly typed dataset only means that VS.NET generates a wrapper/proxy class that you use when exctracting or changing data (in this case in your web service). If the web service didnt make this clear for you check out this article:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcongeneratingstronglytypeddataset.asp

    have fun ;-)
    //AndersR


  • 11-18-2005 06:47 PM In reply to

    • m2land
    • Not Ranked
    • Joined on 10-18-2005
    • China
    • Posts 9

    Re: How create RichtextBox use Webservice datasource

    As metioned in MSDN "The InfoPath implementation of DataSet objects ignores embedded columns with different namespaces. Furthermore, ADO.NET DataSet schemas do not support the xsd:any structure. As a result, data fields within the InfoPath form's DataSet structure cannot be bound to rich-text controls, because the XHTML namespace is ignored. Instead, you can map the text field intended to contain XHTML content to a rich-text field that exists outside of the DataSet structure in the data source."
    So is there any good solution in Infopath SP2?
  • 11-19-2005 04:16 AM In reply to

    Re: How create RichtextBox use Webservice datasource

    You mention the solution just there. The next lines in the article demonstrates how to do this.


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