wordpress hit counter
Understanding CellFormating and How it is stored - .Net - Development Tools - OpenXML Developer

Understanding CellFormating and How it is stored

Development Tools

Discussions about working with Open XML using a wide range of development tools

Understanding CellFormating and How it is stored

  • rated by 0 users
  • This post has 1 Reply |
  • 2 Followers
  • I am trying to understand how to extract or even understand how cell formatting is stored. I found that <b/> in the <font> signifies the cell is bold. But how is it stored if several words in the file are bolded and several are not. I need to be able to copy the values and preserve there formatting. Any help will be greatly appreciated.

  • I put "This is a bold test" in a cell and the shared string entry looks like this:

      <si>
        <r>
          <t xml:space="preserve">This is a </t>
        </r>
        <r>
          <rPr>
            <b/>
            <sz val="11"/>
            <color theme="1"/>
            <rFont val="Calibri"/>
            <family val="2"/>
            <scheme val="minor"/>
          </rPr>
          <t>bold</t>
        </r>
        <r>
          <rPr>
            <sz val="11"/>
            <color theme="1"/>
            <rFont val="Calibri"/>
            <family val="2"/>
            <scheme val="minor"/>
          </rPr>
          <t xml:space="preserve"> test</t>
        </r>
      </si>
    

    The "r" elements are "runs" of text. Each run of text has the same formatting. The "rPr" shows the properties of that run. Any properties set for a run will still apply for other runs unless those properties are replaced by new values. In this example, the word "bold" had a bold font property and then the run for the rest of the text does not have a bold font.

    The same type of formatting can also appear in an inline string (is element for a cell with the "inlineStr" type).

Page 1 of 1 (2 items)