| Paul 的个人资料Paul Galvin's SharePoint...日志列表SkyDrive | 帮助 |
|
|
10月27日 Quick Hit: Reading InfoPath XML Directly From an SPListItem in SharePointI’m been working on a project where I need to extract attachments from an InfoPath form. There are some good resources for parsing InfoPath forms (which are just XML files, so it’s actually quite easy). While I was building up the project, I started by downloading an InfoPath form and saving it to my local hard drive. My c# code was reading directly from that instance. However, the InfoPath forms are really living inside a SharePoint forms library. I did a little half hearted searching to find out how to read it directly from the library and almost gave up, in which case I would have saved the form to a local temp directory and read it from there. However, there’s no need to go through those hoops as you can read it directly from the library. This little snippet shows how:
They key bit above is that we can read the InfoPath directly via the OpenBinaryStream() method call on the SPFile as a parameter to the constructor on XmlTextReader. It works great. </end>
Technorati Tags: InfoPath 引用通告此日志的引用通告 URL 是: http://paulgalvin.spaces.live.com/blog/cns!1CC1EDB3DAA9B8AA!4936.trak 引用此项的网络日志
|
|
|