Excel Export error - Excel found unreadable content in File.

Excel Export error - Excel found unreadable content in File.

Manoj542Manoj542 Posts: 5Questions: 1Answers: 0

When I am trying to do Excel Export facing the error "Excel found unreadable content in the file. Dom you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes"> Once I click 'Yes', File tries to open in Protected view but throws an error saying 'Excel completed file level validation and repair. Some parts of this workbook may have been repaired or discarded. Replaced Part: /xl/worksheets/sheet1.xml part with XML error. A qualified name cannot contain multiple colons. Line 1, column 1456.'

But I am able to export the same data into CSV format without any issues. I am using HTML buttons and in IE 11.

Can you please help me out on this issue? I am using below versions for the same.

DataTables 1.5.2
1.

Answers

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin

    Unfortunately this is a bug in Buttons 1.5.2 - see this thread for details. I'll be committed a fix soon.

    Allan

  • nhadronhadro Posts: 1Questions: 0Answers: 0

    I am also having this problem. Allen, do you know if this has been resolved? I saw a 1.5.3 version, but it looks like it was for some styling issues and no code was updated.

  • kthorngrenkthorngren Posts: 21,341Questions: 26Answers: 4,954

    There have been a lot of threads on issues with IE 11. The fix is in the nightly version. It seems to have resolved the issue for many. AFAIK Buttons 1.5.3 has not been released yet.

    Give the nightly version a try and let us know the results.

    Kevin

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin

    Kevin is spot on as usual. The nightly version fixes it. I'll package up 1.5.3 this week as I really need to get that pushed out - just been working on other things!

    Allan

  • slawofgravityslawofgravity Posts: 4Questions: 0Answers: 0

    I've also had this issue with my application since upgrading Buttons from 1.5.1 to 1.5.2, and the fixes in the nightly version fixed it almost everywhere. There's still one table where I'm extending the export to add column auto filters to the Excel sheet (as in this forum answer). The error "Non-default namespace declarations must not have an empty URI" is thrown on this line:

    var xmlDoc = parser.parseFromString(xmlString,'text/xml');
    

    Is this a known issue, and does 1.5.3 resolve it?

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin

    Its not a known issue. Can you give me an example showing the combination of the auto filters and the nightly version please?

    Allan

  • slawofgravityslawofgravity Posts: 4Questions: 0Answers: 0

    Here's a rough version of what I'm doing: http://live.datatables.net/yifojova/1/edit

  • slawofgravityslawofgravity Posts: 4Questions: 0Answers: 0

    Fixed some errors so it actually runs: http://live.datatables.net/yifojova/2/edit

    Note: the issue is specific to IE11.

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin

    Thank you - I'll take a look into this before 1.5.3 is tagged.

    Allan

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin

    Using XMLSerializer in IE is fraught with issues. If you have a look at the Buttons code you'll see I have a number of workarounds for it.

    Instead of using the approach above, I've decided to go ahead and provide the ability to enable this feature in Buttons itself. There is now a autoFilter option which can be used to enable the auto filter feature in Excel:

    $('#myTable').DataTable( {
        buttons: [
            {
                extend: 'excelHtml5',
                autoFilter: true
            }
        ]
    } );
    

    Commit

    This will be in 1.5.4 or you can grab the latest source from GitHub or the nightly which will be up to date shortly.

    Allan

  • slawofgravityslawofgravity Posts: 4Questions: 0Answers: 0

    That's great news! Thanks for looking into the issue.

  • REJISREJIS Posts: 15Questions: 4Answers: 0

    I'm still only seeing Buttons 1.5.2 on Nightly and even older stuff no longer touched on Github. (Not even seeing Buttons) How long before this is in the bundle with everything?

  • allanallan Posts: 63,516Questions: 1Answers: 10,473 Site admin

    Not long. I've got one for issue I want to fix before issuing the next Buttons update.

    Allan

  • nikunjkalyaninikunjkalyani Posts: 1Questions: 0Answers: 0

    Thanks, looking forward for the update.

  • chetankjainchetankjain Posts: 1Questions: 0Answers: 0
    edited February 2019

    Hi,

    I'm using Buttons 1.5.4 and found the same issue with below error: (file is attached)

    <recoveryLog xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
    <logFileName>Repair Result to settings3.xml</logFileName>
    <summary>Errors were detected in file '/Users/chetan/Downloads/settings.xlsx'</summary>
    <removedParts summary="Following is a list of removed parts:">
    <removedPart>Removed Part: /xl/styles.xml part with XML error.  
    (Styles) Xml parsing error Line 1, column 400.</removedPart></removedParts>
    <repairedRecords summary="Following is a list of repairs:">
    <repairedRecord>Repaired Records: Cell information from /xl/worksheets/sheet1.xml part</repairedRecord></repairedRecords></recoveryLog>
    

    the styles.xml seems be wrong here:

    <numFmt numFmtId="165" formatCode="&quot;£¬&quot;#,##0.00"/>
    

    Any help pls...

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @chetankjain ,

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • AndyRobertsAndyRoberts Posts: 1Questions: 0Answers: 0

    Explanation to Mend Excel File Error 'Unable to read file'
    I have suggested certain steps to recover excel file ‘unable to read’. You can also try them out for solving your problem regarding excel

    Attempt to get opened your '.xls' file by making it 'read-only'. (Follow the technique given below to make text 'Read-Only'):

    • Press on the ‘Office button’ and choose ‘save’ for new content or ‘save as’ for formerly saved document.

    • Press on the ‘Tools’ and choose ‘General Options’

    • Lastly, tick on the ‘read-only’ check-box to make content read-only

    • Get a fresh and empty '.xls' file and copy entire thing from the corrupt Excel file to this new file. Save this file and try to open it once more.

    • Some times, it is seen that connecting the 'Visual Basic' component of MS Office 2010 decides the error message. Follow the below mentioned steps to do the same:
    • 'Navigate to 'Control Panel >> Programs' -> select Microsoft Office 2010, and then click 'Change >> Add or Remove Programs' -> at the bottom of this list, click the 'plus' sign provided next to Office Shared Features -> click Visual Basic for Applications -> After that, right-click and choose Run from My Computer -> click Continue'.

    • Restart your system when this procedure ends

This discussion has been closed.