Xpath and Exporting to Excel

J

Jeff

Is there a way to only have the field name export instead of the field name
concatenated with the xpath? (Using Infopath 2003) I have tried creating a
different view and copying pasting fields onto it then exporting, adding a
Screentip that contained just the fieldname and then exporting, adding an
Expressionbox with/without formula for a field and exporting it, but none of
these things mattered. In fact the Expressionbox didnt export at all. It
wasnt even an option as a field TO export.

Also, I've seen a number of people asking about exporting to Excel as a CSV
file, but havent seen an answer to that problem. So let me ask it this way.
Is there any way to automate this so that the user just clicks a button on th
form? Would creating a webservice of some sort be of any help? Any other
ideas on this would be appreciated.
 
B

Ben Walters

Hey Jeff,
InfoPath 2003 will only allow you to automatically export to a .MHT file via
code.

If you wanted to export to a .csv you would need to create some code to
parse the underlying xml for the form and save this out to a file.
Remember though if you create code that is writing to the file system it
will need to be fully trusted, or digitally signed.
Of course another option is to pass the xml to a web service and let the web
service do the XML parsing work and save the file to a network location.

hope this helps

Ben
 
S

S.Y.M. Wong-A-Ton

In addition to Ben's answer, you could also use Excel automation from within
InfoPath (you'll have to write code) to parse the XML of the form, create an
Excel document, and open it up in Excel.
 
Top