Export to Excel Issue - InfoPath Dev
in

InfoPath Dev

Export to Excel Issue

Last post 10-08-2007 04:20 PM by Greg Collins. 11 replies.
Page 1 of 1 (12 items)
Sort Posts: Previous Next
  • 11-15-2004 02:05 PM

    Export to Excel Issue

    When I attempt to use the Export to Excel wizard to export data from a repeating table, I find that the option "Form fields only (no tables or lists)" is the only one available (the other which should allow me to export my repeating table data is grayed out). I cannot figure out why the other option is not available and I really need to export my repeating table. Please help if you know why this might be happening!
  • 11-30-2004 04:54 PM In reply to

    Any thoughts on this one?
  • 11-30-2004 05:44 PM In reply to

    I've not used the feature very much... so I don't know... but I'll guess and ask: "Is your repeating table from a secondary data source?"

    Greg Collins [InfoPath MVP]
  • 12-01-2004 12:21 PM In reply to

    Ah yes it is from a secondary data source. Could this be the reason I am unable to export? And if so, how do I go about exporting this data?
  • 12-01-2004 12:44 PM In reply to

    Again... I'm only guessing... I really don't have a real answer for you... I'm just hoping to help you stumble onto the solution.

    I know secondary data sources are essentially second-class citizens in InfoPath right now. There's a lot of things grayed out for them that aren't for the main data source.

    Patrick asks whether your table that you want to export is present in the view?

    Greg Collins [InfoPath MVP]
  • 12-03-2004 02:32 AM In reply to

    You can write code to automate Excel,
    Or, import the XML from within Excel,
    Or, make the secondary data part of your main DOM!

    Excel has some good XML support in 2003. You can specify a binding and load
    the xml saved by InfoPath into Excel separately (from Excel). There are some
    limitations - for example, Excel won't deal with rich text nodes nor will it
    grok xsd:any, but outside of that, you should be fine importing from Excel

    The InfoPath export to Excel option is rather limited. I was the dev lead on
    the feature and I still understand it pretty well. We had great plans for it
    but Excel ended up limiting some functionality that made it hard to export
    everything. The transformation is also limited to single tables or all leaf
    nodes, but I think you already figure that out.

    My suggestion would be to create the "map" in Excel and then import the
    InfoPath-generated XML. If this is too clunky, try changing the secondary
    data to include in your main DOM (or import it into a separate InfoPath
    solution that uses it as a main DOM). Finally, there is always the
    do-it-yourself coding option.

    Hope this helps,
    Patrick
    Patrick Halstead
    Project Manager at Qdabra
  • 12-03-2004 02:43 PM In reply to

    As always, the help is much appreciated. I think I will use code and Excel automation to accomplish the task.
  • 12-21-2004 11:53 AM In reply to

    Task completed.

    The basic code I used to open and write to Excel from Infopath (using VBScript) is this:

    Dim objExcel
    Dim objNodeList
    Dim objNode
    Dim i
    Dim rowindex

    Set objExcel = CreateObject("Excel.Application")
    objExcel.workbooks.add
    objExcel.visible = true
    rowindex = 1

    'Code below gets the data from the repeating table which is bound to a secondary data source

    set objNodeList = XDocument.DataObjects("DataSourceName").DOM.getElementsByTagName("d:TableName")

    'The code below is a loop which takes each row of the repeating table, extracts each column and writes each column to Excel

    for i=0 to (objNodeList.length - 1)

    objNode = objNodeList.Item(i).getAttribute("Attribute1")
    objExcel.workbooks(1).worksheets(1).cells(rowindex,1) = objNode

    objNode = objNodeList.Item(i).getAttribute("Attribute2")
    objExcel.workbooks(1).worksheets(1).cells(rowindex,2) = objNode

    objNode = objNodeList.Item(i).getAttribute("Attribute3")
    objExcel.workbooks(1).worksheets(1).cells(rowindex,3) = objNode

    rowindex = rowindex + 1

    next

  • 12-22-2004 01:41 AM In reply to

    Very glad to hear you accomplished your task. Thanks for sharing!
    Patrick Halstead
    Project Manager at Qdabra
  • 09-13-2007 04:15 AM In reply to

    Is ther some JScript equavilent for this?

  • 10-05-2007 05:57 AM In reply to

    Thanks for the tip. I have managed to export data to excel from a specific form stored on out Sharepoint Site by specifing a map. I'm looking for a way to create a map that will export data from the currently open form to Excel.

    Is there an easy way to do this?

  • 10-08-2007 04:20 PM In reply to

    Glad to hear you got everything working! Thanks for sharing your solution with us!

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