Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Unable to export Listgrid contents to xls and ooxml formats

    Version : smartclient v9.0p_2013-11-03
    Browsers : All

    Hi we are having an issue when trying to export listGrid contents to xls and ooxml formats. exporting to csv format is working fine.


    This is how we are making the call to export the data

    listGrid.exportClientData({ exportAs: "ooxml"});

    we have even tried

    listGrid.exportData({ exportAs: "ooxml"});

    When we try to open the file after the export is complete we get the following error

    Excel cannot open the file export.xlsx because the file format or file extension is not valid. Verify that the file has not been corrupted and that the file extension matches the format of the file.

    When we check the content in Fiddler when exporting as csv we see the following

    HTTP/1.1 200 OK
    Date: Fri, 13 Mar 2015 13:57:11 GMT
    Server: Apache-Coyote/1.1
    X-Included-Test2: true
    X-Included-Test: true
    content-disposition: attachment; fileName=export.csv
    Content-Type: text/csv;charset=UTF-8
    Keep-Alive: timeout=5, max=100
    Connection: Keep-Alive
    Content-Length: 3059

    [
    data
    ]

    And when exporting as xls or ooxml we see the following

    HTTP/1.1 200 OK
    Date: Fri, 13 Mar 2015 14:15:24 GMT
    Server: Apache-Coyote/1.1
    X-Included-Test2: true
    X-Included-Test: true
    content-disposition: attachment; fileName=export.xlsx
    Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8
    Content-Length: 0
    Keep-Alive: timeout=5, max=100
    Connection: Keep-Alive

    [
    No data
    ]

    Can you please let us know if we are missing something while making the call to exportData/exportClientData that is causing the issue.

    Also do we need to have the "exportFormat" defined on the listGrid fields?

    #2
    Your calls are fine and to can see this working in many samples.

    Start by providing the required diagnostics - server logs are missing.

    Comment


      #3
      We were missing the poi,dom4j and xmlbeans jars in our classpath and that was the cause of the issue. Once we added them we are now able to download the data in xls and ooxml formats.

      Comment

      Working...
      X