Note that there are some explanatory texts on larger screens.

plurals
  1. POXlsx styles getting wrong fill pattern
    primarykey
    data
    text
    <p>I am writing an xlsx file where I want to apply my own styles to cells in a worksheet. I have a case where style 1 and style 2 both specify solid red, but when I open it in excel the first is gray stippled but the second is what I expect. I am stumped.. Here are some bits of xml from the attached file.</p> <p>In the worksheet, I have 2 cells:</p> <pre><code> &lt;x:c t="inlineStr" s="2"&gt; &lt;x:is&gt; &lt;x:t&gt;looks right&lt;/x:t&gt; &lt;/x:is&gt; &lt;/x:c&gt; &lt;x:c t="inlineStr" s="1"&gt; &lt;x:is&gt; &lt;x:t&gt;looks wrong&lt;/x:t&gt; &lt;/x:is&gt; &lt;/x:c&gt; </code></pre> <p>In the styles.xml file, I define these cell styles as follows:</p> <pre><code>&lt;x:cellXfs&gt; &lt;x:xf borderId="0" fillId="0" fontId="0" numFmtId="0"/&gt; &lt;x:xf fillId="1" applyFill="1"/&gt; &lt;x:xf fillId="2" applyFill="1"/&gt; &lt;/x:cellXfs&gt; </code></pre> <p>Where the fills are:</p> <pre><code>&lt;x:fills&gt; &lt;x:fill&gt; &lt;x:patternFill patternType="none"/&gt; &lt;/x:fill&gt; &lt;x:fill&gt; &lt;x:patternFill patternType="solid"&gt; &lt;x:fgColor rgb="FFFF0000"/&gt; &lt;/x:patternFill&gt; &lt;/x:fill&gt; &lt;x:fill&gt; &lt;x:patternFill patternType="solid"&gt; &lt;x:fgColor rgb="FFFF0000"/&gt; &lt;/x:patternFill&gt; &lt;/x:fill&gt; &lt;/x:fills&gt; </code></pre> <p>Fills 1 and 2 are both solid red, so cell styles 1 and 2 should be identical, right? But they are not.</p> <p>Is this an Excel bug? Is there a pre-defined fill style numbered 1 that overrides my definition?</p> <p>Hmm, I don't see how to attach a file to a question...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload