Skip to content

Infragistics Community Forum / Desktop / Ultimate UI for Windows Forms / Workbook.Save Causes Table XML Errors

Workbook.Save Causes Table XML Errors

New Discussion
Kyle
Kyle asked on Jun 6, 2017 5:56 PM

I am working on a simple import modify and export program and when I open the exported file it tells me there are errors in the table xml. It is capable of fixing these errors and everything looks great, but it is rather annoying to have that pop up when you open the file for the first time after export.

I tried to simplify the code as much as possible while still getting the error and it ended up as:

Workbook importedWorkbook = Workbook.Load(“C:\\Users\\admin\\Documents\\import.xlsx”);
importedWorkbook.Save(“C:\\Users\\admin\\Documents\\export.xlsx”);

With no modification to the file I am still getting table xml errors!

I am using Infragistics 4 Excel v15.1. Unfortunately I can not give you the excel document I am working with but the original table xml is:

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”true”?>

-<table headerRowBorderDxfId=”637″ totalsRowDxfId=”636″ headerRowDxfId=”638″ totalsRowCount=”1″ ref=”A1:N5″ displayName=”Table2436784757″ name=”Table2436784757″ id=”56″ xmlns=”http://schemas.openxmlformats.org/spreadsheetml/2006/main”&gt;

<autoFilter ref=”A1:N4″/>

-<sortState ref=”A2:Q92″>

<sortCondition ref=”K1:K92″/>

</sortState>

-<tableColumns count=”14″>

<tableColumn totalsRowDxfId=”634″ name=”Test Name” id=”1″ dataDxfId=”635″/>

<tableColumn totalsRowDxfId=”632″ name=”Assignee” id=”12″ dataDxfId=”633″/>

<tableColumn totalsRowDxfId=”630″ name=”Automated?” id=”10″ dataDxfId=”631″/>

<tableColumn totalsRowDxfId=”628″ name=”FV GDS Status” id=”2″ dataDxfId=”629″/>

<tableColumn totalsRowDxfId=”626″ name=”# Validation or Functional_x000a_Points” id=”7″ dataDxfId=”627″/>

<tableColumn totalsRowDxfId=”624″ name=”# Validation or Functional_x000a_Points Passed” id=”8″ dataDxfId=”625″/>

<tableColumn totalsRowDxfId=”622″ name=”# Tot Reqs” id=”5″ dataDxfId=”623″/>

<tableColumn totalsRowDxfId=”620″ name=”Reqs Passed” id=”15″ dataDxfId=”621″/>

<tableColumn totalsRowDxfId=”618″ name=”Reqs Failed” id=”16″ dataDxfId=”619″/>

<tableColumn totalsRowDxfId=”616″ name=”Reqs Not Tested” id=”6″ dataDxfId=”617″/>

<tableColumn totalsRowDxfId=”614″ name=”Reqs#” id=”9″ dataDxfId=”615″/>

<tableColumn totalsRowDxfId=”612″ name=”Notes” id=”3″ dataDxfId=”613″/>

<tableColumn totalsRowDxfId=”610″ name=”Date Testing Completed” id=”4″ dataDxfId=”611″/>

<tableColumn totalsRowDxfId=”608″ name=”Data Used” id=”11″ dataDxfId=”609″/>

</tableColumns>

<tableStyleInfo name=”TableStyleMedium9″ showColumnStripes=”0″ showRowStripes=”1″ showLastColumn=”0″ showFirstColumn=”0″/>

</table>

The exported table xml is:

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”true”?>

-<table xmlns=”http://schemas.openxmlformats.org/spreadsheetml/2006/main&#8221; totalsRowCellStyle=”Normal” headerRowCellStyle=”Normal” totalsRowBorderDxfId=”3″ headerRowBorderDxfId=”1″ totalsRowDxfId=”2″ headerRowDxfId=”0″ totalsRowCount=”1″ ref=”A1:N5″ displayName=”Table2436784757″ name=”Table2436784757″ id=”56″>

<autoFilter ref=”A1:N4″/>

-<sortState ref=”A1:N4″>

<sortCondition ref=”K1:K4″/>

</sortState>

-<tableColumns count=”14″>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”5″ name=”Test Name” id=”1″ dataCellStyle=”Normal” dataDxfId=”4″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”7″ name=”Assignee” id=”12″ dataCellStyle=”Normal” dataDxfId=”6″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”9″ name=”Automated?” id=”10″ dataCellStyle=”Normal” dataDxfId=”8″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”11″ name=”FV GDS Status” id=”2″ dataCellStyle=”Normal” dataDxfId=”10″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”13″ name=”# Validation or Functional Points” id=”7″ dataCellStyle=”Normal” dataDxfId=”12″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”15″ name=”# Validation or Functional Points Passed” id=”8″ dataCellStyle=”Normal” dataDxfId=”14″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”17″ name=”# Tot Reqs” id=”5″ dataCellStyle=”Normal” dataDxfId=”16″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”19″ name=”Reqs Passed” id=”15″ dataCellStyle=”Normal” dataDxfId=”18″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”21″ name=”Reqs Failed” id=”16″ dataCellStyle=”Normal” dataDxfId=”20″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”23″ name=”Reqs Not Tested” id=”6″ dataCellStyle=”Normal” dataDxfId=”22″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”25″ name=”Reqs#” id=”9″ dataCellStyle=”Normal” dataDxfId=”24″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”27″ name=”Notes” id=”3″ dataCellStyle=”Normal” dataDxfId=”26″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”29″ name=”Date Testing Completed” id=”4″ dataCellStyle=”Normal” dataDxfId=”28″/>

<tableColumn totalsRowCellStyle=”Normal” totalsRowDxfId=”31″ name=”Data Used” id=”11″ dataCellStyle=”Normal” dataDxfId=”30″/>

</tableColumns>

<tableStyleInfo name=”TableStyleMedium9″ showColumnStripes=”0″ showRowStripes=”1″ showLastColumn=”0″ showFirstColumn=”0″/>

</table>

Any help would be appreciated.

Thanks!

Sign In to post a reply

Replies

  • 0
    Michael Germann
    Michael Germann answered on Jun 2, 2017 11:57 PM

    Hi Kyle,

       While I understand your concern about posting a live Excel file, I am going to need a complete sample file to test against to better understand the issue. Just copy your live file, and replace all the live data with a few rows of dummy data and verify that the dummy file has the same issue. We will need a file to work from.

    Thanks,

    • 0
      Kyle
      Kyle answered on Jun 5, 2017 2:27 PM

      Funnily enough it will not let me attach an xlsx file, so I changed the extension to zip. I've narrowed the problem down specifically to a cell having multiple lines, which is all the attached worksheet has in it.

      • 0
        Michael Germann
        Michael Germann answered on Jun 5, 2017 11:13 PM

        Hi Kyle,

        I am not able to reproduce the behavior. I’ve tried with 15.1 as well as 16.2. Perhaps I am not following exactly where you are getting the XML issues. Attached is my sample application. Two buttons import, and export. I then open the exported file in Excel, and it works fine. I have commented out the 16.2 specific code that is using the Spreadsheet, importing into that control as well. But it works fine, far as I can tell. What is the full build number for the version that you are using? Perhaps I was not following the exact step that you see the behavior in, is it an exception thrown in either .NET or Excel? Are you looking at a specific XML file inside the XLSX file?

        Try it out, and if there is something I am missing in my sample please update it, or elaborate on how to reproduce the issue.
        XMLImportIntoWorkbook

      • 0
        Kyle
        Kyle answered on Jun 6, 2017 2:17 PM

        My apologies, I could have sworn that book was showing the error, but I could not reproduce it either with that file, or a file I created to mimic it.

        I added a table to the file however, and it is now causing the same error I was expecting, which makes sense as it was an error with the table.xml.

        I have attached the file I used, and triple checked that it was causing the error with the example program you created.

        Again, my sincerest apologies for the confusion.

      • 0
        Michael Germann
        Michael Germann answered on Jun 6, 2017 5:56 PM

        Hi Kyle,

        Thank you for the updated file, I was able to demonstrate the behavior with the sample I provided earlier. It seems that how we are outputting the name with a newline, while Excel recognizes it, it doesn’t appear to be it’s ideal format.

        If you change the extension to zip, you can look inside the files to “xl\tables\table1.xml”
        You will notice:
        INPUT:
        <tableColumn id=”1″ name=”table with_x000a_new line” dataDxfId=”0″/>
        OUTPUT:
        <tableColumn id=”1″ name=”table with&#xD;&#xA;new line” dataDxfId=”2″ />
        FIXED BY EXCEL:
        <tableColumn id=”1″ name=”table with_x000d__x000a_new line” dataDxfId=”0″/>

        If you save it, or manually change the table name such that &#xD;&#xA; is translated to _x000d__x000a_it works fine.

        I will log this as a issue with our developers and see if they can address the issue. It should be noted that 2015.1 is outside of our service release support. So if they do have only address this as a fix in our code it will be for those builds currently in service release support. Which at this time is 2016.2 and later.

        I will link this forum post to our support system, which you should be able to see that and the development issue through our support system here:
        https://www.infragistics.com/my-account/support-activity

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Kyle
Favorites
0
Replies
5
Created On
Jun 06, 2017
Last Post
8 years, 8 months ago

Suggested Discussions

Created by

Created on

Jun 6, 2017 5:56 PM

Last activity on

Feb 11, 2026 9:02 PM