[CLOSED] Export grid to xls, Excel show the message "A file is in a different format than its extension indicates in Excel"

  1. #1

    [CLOSED] Export grid to xls, Excel show the message "A file is in a different format than its extension indicates in Excel"

    Hi,
    in your example https://examples4.ext.net/#/GridPane...ort_Data_Ajax/ , when I open the .xls file, Excel says that the file is in different format than its extension indicates.
    Is there a way to prevent Excel from showing that message?
    Thank you

    Jimmy
  2. #2
    Hi Jimmy,

    Exporting to Excel is not built-in functionality of Ext.NET. I believe in the sample you linked to we are just using XSL to transform the data into .csv format. The XSL could be adjusted as per your requirements.
    Geoffrey McGill
    Founder
  3. #3
    Hello Jimmy!

    Just to add up a little to Geoffrey's answer, the format currently saved by the example is closest to the "XML Spreadsheet 2003" I see in the options when we try to "save as" in MS-Excel, at least as of Excel 2013.

    So it seems at some point Excel stopped trusting the format as .xls, probably to enforce their binary formats or maybe some security flaw.

    Unfortunately there seems not to be an easy solution for that, as I tried the solution in this stackoverflow thread and renaming to .xlsx didn't work either. At least it adds info as to where exactly the issue was introduced. If you have MS-Office license on your hosting server, using office interop should be a great way to get what you need.

    Hope this helps!
    Last edited by fabricio.murta; May 10, 2019 at 10:31 PM. Reason: stack overflow link missing

Similar Threads

  1. [CLOSED] Export Excel Number Format Problem
    By ddeniz in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: May 09, 2014, 1:36 PM
  2. Replies: 0
    Last Post: Jul 30, 2012, 3:32 PM
  3. Replies: 1
    Last Post: May 28, 2012, 5:17 AM
  4. Replies: 2
    Last Post: May 19, 2012, 9:09 AM
  5. Replies: 2
    Last Post: May 15, 2009, 9:41 AM

Posting Permissions