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

  1. #1

    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://examples.ext.net/#/GridPanel...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 & CEO
  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] always show "request failure" message box
    By hdsoso in forum 2.x Premium Help
    Replies: 9
    Last Post: Jul 07, 2014, 2:24 PM
  2. [CLOSED] Export Excel Number Format Problem
    By ddeniz in forum 2.x Premium Help
    Replies: 1
    Last Post: May 09, 2014, 1:36 PM
  3. [CLOSED] [MVC] Export Excel return "BADRESPONSE: Unexpected token <"
    By UnifyEducation in forum 2.x Premium Help
    Replies: 1
    Last Post: Aug 02, 2012, 3:05 PM
  4. Replies: 1
    Last Post: May 28, 2012, 5:17 AM
  5. [CLOSED] renderScripts="File" renderStyles="File" adding extra '/'
    By SouthDeveloper in forum 1.x Premium Help
    Replies: 8
    Last Post: Nov 24, 2011, 12:23 PM

Posting Permissions