none
How can I get table column actual width from xml excel 2003? RRS feed

  • Question

  • I need read column width and row height from xml excel 2003 for printing.But I found that is no law.

    Fox example:

        Open a xls file and set columns width 1mm、2mm、3mm、4mm、5mm.Then file save as  xml excel 2003.Open xml file,the value of  columns were 9.6、15、23.4、25.8、31.2.It is no law.

        How can I get table column actual width from xml excel 2003?

    Wednesday, November 30, 2016 9:00 AM

Answers

  • Hi marchrain_, it appears that the way the column width is specified in the 2003 XML format is the same as it is in the current version of Excel. This is described in ISO/IEC 29500-1 section 18.3.1.13 which states that it is "measured as the number of characters of the maximum digit width of the numbers 0, 1, 2, …, 9 as rendered in the normal style's font. There are 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines."

     

    The following KB article further describes "…how column widths are determined in Excel"

    https://support.microsoft.com/en-us/kb/214123

     

    I also verified that it's very likely that the 2003 XML format uses this same method by referencing the final draft of the TC-45 standard from 2006, which is the predecessor of the current ISO/IEC 29500 standard. The column element is described in part 4, section 3.3.1.12. The example provided and the attribute descriptions look identical to the current version.

     

    After reviewing the document that you provided it is my belief that the 2003 XML format also uses this same method for specifying the width. This means that it's not possible to specify the width of the columns in mm without going through some painstaking calculations based on the "maximum digit width" which is dependent on the font face, size, and dpi which will can vary greatly across platforms and display devices and is beyond the scope of the Open Specifications documentation.

     

    Please let me know if you have any other questions. Thank you.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Friday, December 2, 2016 8:42 PM
    Moderator

All replies

  • Hi Marchrain_:

    I have alerted the open specifications team regarding your inquiry. A member of the team will be in touch soon.


    Regards, Obaid Farooqi

    Wednesday, November 30, 2016 6:26 PM
    Owner
  • Hi marchrain_, I am the engineer who will be working with you on this issue. The Excel 2003 XML format is not covered by ISO/IEC 29500, MS-OI29500, or MS-XLSX. However, I expect that it may be similar enough to be able to find an answer to your question. Would you be able to send me the file that you are working on so that I can review the exact issue that you are seeing? If that works for you, please send it to dochelp@microsoft.com to my attention and reference this thread.

     

    Thank you.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Wednesday, November 30, 2016 11:03 PM
    Moderator
  • Thanks a lot!

    I have sent an e-mail to dochelp@microsoft.com,please check.

    Thursday, December 1, 2016 2:46 AM
  • Hi marchrain_, it appears that the way the column width is specified in the 2003 XML format is the same as it is in the current version of Excel. This is described in ISO/IEC 29500-1 section 18.3.1.13 which states that it is "measured as the number of characters of the maximum digit width of the numbers 0, 1, 2, …, 9 as rendered in the normal style's font. There are 4 pixels of margin padding (two on each side), plus 1 pixel padding for the gridlines."

     

    The following KB article further describes "…how column widths are determined in Excel"

    https://support.microsoft.com/en-us/kb/214123

     

    I also verified that it's very likely that the 2003 XML format uses this same method by referencing the final draft of the TC-45 standard from 2006, which is the predecessor of the current ISO/IEC 29500 standard. The column element is described in part 4, section 3.3.1.12. The example provided and the attribute descriptions look identical to the current version.

     

    After reviewing the document that you provided it is my belief that the 2003 XML format also uses this same method for specifying the width. This means that it's not possible to specify the width of the columns in mm without going through some painstaking calculations based on the "maximum digit width" which is dependent on the font face, size, and dpi which will can vary greatly across platforms and display devices and is beyond the scope of the Open Specifications documentation.

     

    Please let me know if you have any other questions. Thank you.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Friday, December 2, 2016 8:42 PM
    Moderator