Tuesday, February 9, 2010

InfoPath 2003 Master/Detail with SharePoint List Sources

REF: http://randomdust.com/blogs/ryan/archive/2008/07/02/infopath-master-detail-with-sharepoint-list-sources.aspx

I don’t know if this is specific to SharePoint sources or just external sources in general, but you can’t use a SharePoint source in a master/detail relationship. After dragging it onto the form, right click on the repeating table and view the properties. The master/detail section is grayed out. The second thing I ran into was trying to filter the SharePoint connection. No luck there either, it’s not available.

After some searching, I found a post on implementing master/detail for a web based form which detailed some steps to pull in SharePoint data using a different method. Instead of using the SharePoint List option when creating the connection, you use the XML option and point it to a URL which outputs the list data in XML format. I won’t cover the details of that here as he covers it his post very well, but it’s using owssvr.dll. That post solved my issues completely, but it was using code for InfoPath 2007. I needed to convert that to be 2003 compatible.

Since the 2003 compatible code is probably the only useful part of this post, here it is:

http://randomdust.com/blogs/ryan/archive/2008/07/02/infopath-master-detail-with-sharepoint-list-sources.aspx


Pretty simple, but it took some SDK searching to find the right classes. I’m using the XMLFileAdapterObject to grab the “Card Version owssvr” data connection, then I change the URL using FileURL similar to how Ishai modified the FileLocation property of the FileQueryConnection object. Like I said, nothing fancy, but I thought it may come in handy for folks looking for a solution similar to Ishai’s, but who can’t use InfoPath 2007.

No comments:

Post a Comment