I’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 (a bhfuil ach comhaid XML, mar sin tá sé i ndáiríre éasca go leor).
Cé go raibh mé ag tógáil suas ar an tionscadal, I started by downloading an InfoPath form and saving it to my local hard drive. My c# code was reading directly from that instance. Mar sin féin, 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. Mar sin féin, there’s no need to go through those hoops as you can read it directly from the library. This little snippet shows how:
/// Stuif sainmhíniú Aicme anseo, lena n-áirítear:
príobháideach SPFile mySharePointFile; /* Cuid de SPList */ // Téann cód Níos anseo agus taobh istigh de modh an rang atá againn: textReader = nua XmlTextReader(mySharePointFile.OpenBinaryStream()); textReader.WhitespaceHandling = WhitespaceHandling.Dada; textReader.Read(); // Má tá luach an nód cé go (textReader.Read()) { |
Tá siad beagán eochair thuas gur féidir linn a léamh ar an InfoPath díreach tríd an OpenBinaryStream() method call on the SPFile as a parameter to the constructor on XmlTextReader. It works great.
</deireadh>
Lean mé ar Twitter ag http://www.twitter.com/pagalvin
Hi,
I need help in this , I have sharepoint 2007 site and infopath with a repeating table , what I need to do is once the form is saved to the sharepoint forms library I need to loop and save the data to a list using SP form library event handler.
Any help is really appreciated.
Go raibh maith agat