title: jsreport handlebars engine and xlsx recipe: how to fill cell with color
body: <p>I'm trying to fill a cell with <em>"red"</em> or <em>"green"</em> depending on its value; This is what I tried so far:</p>
  
  <pre><code>{{#xlsxAdd 'xl/worksheets/sheet1.xml' "worksheet.conditionalFormatting"}}
      &lt;conditionalFormatting sqref="G7:M7"&gt;
          &lt;cfRule type="cellIs" dxfId="0" priority="1" operator="notBetween"&gt;
              &lt;formula&gt;{{productObj.min}}&lt;/formula&gt;
              &lt;formula&gt;{{productObj.max}}&lt;/formula&gt;
          &lt;/cfRule&gt;
      &lt;/conditionalFormatting&gt;
  {{/xlsxAdd}}
  {{#xlsxAdd 'xl/worksheets/sheet1.xml' "worksheet.conditionalFormatting"}}
      &lt;conditionalFormatting sqref="G7:M7"&gt;
          &lt;cfRule type="cellIs" dxfId="2" priority="1" operator="between"&gt;
              &lt;formula&gt;{{productObj.min}}&lt;/formula&gt;
              &lt;formula&gt;{{productObj.max}}&lt;/formula&gt;
          &lt;/cfRule&gt;
      &lt;/conditionalFormatting&gt;
  {{/xlsxAdd}}
  </code></pre>
  
  <p>but it seems that the condition <code>notBetween</code> always matches the cell, but after I download the file then change the value of the cell, the conditions start to work correctly.</p>
  
  <p>I don't know if reportjs is considering my numbers as <strong><code>strings</code></strong> since changing the value after downloading the file works perfectly.</p>
  
  <p>-- UPDATE ---</p>
  
  <p>Found this issue: <a href="https://github.com/jsreport/jsreport-html-to-xlsx/issues/7" rel="nofollow noreferrer">https://github.com/jsreport/jsreport-html-to-xlsx/issues/7</a></p>
  
  <p>It was a problem with jsreport it's self for adding <code>'</code> before my numbers which caused the conditional rendering to fail.
  but still, I would appreciate a proper way to fill a cell "NOT" with the conditional formatting so I'll leave the question</p>
  
  <p>--- END UPDATE ---</p>
  
  <p>I also tried to fill with static color this but it didn't work:</p>
  
  <pre><code> {{#xlsxReplace "xl/styles.xml" "styleSheet.fills"}}
      &lt;fills count="5"&gt;
          &lt;fill&gt;
              &lt;patternFill patternType="none"/&gt;
          &lt;/fill&gt;
          &lt;fill&gt;
              &lt;patternFill patternType="lightGray"/&gt;
          &lt;/fill&gt;
          &lt;fill&gt;
              &lt;patternFill patternType="solid"&gt;
                  &lt;fgColor rgb="FFBFBFBF"/&gt;
                  &lt;bgColor rgb="FFBFBFBF"/&gt;
              &lt;/patternFill&gt;
          &lt;/fill&gt;
          &lt;fill&gt;
              &lt;patternFill patternType="solid"&gt;
                  &lt;fgColor rgb="FFFF0000"/&gt;
                  &lt;bgColor rgb="FFFF0000"/&gt;
              &lt;/patternFill&gt;
          &lt;/fill&gt;
          &lt;fill&gt;
              &lt;patternFill patternType="solid"&gt;
                  &lt;fgColor rgb="FF00FF00"/&gt;
                  &lt;bgColor rgb="FF00FF00"/&gt;
              &lt;/patternFill&gt;
          &lt;/fill&gt;
      &lt;/fills&gt;
  {{/xlsxReplace}}
  // then adding the cell like this:
   &lt;c t="inlineStr" fillId="3" &gt;&lt;is&gt;&lt;t&gt;{{val}}&lt;/t&gt;&lt;/is&gt;&lt;/c&gt;
  </code></pre>
  
  <p>but still not doing the job, I even tried to add <code>dxfs</code> instead of <code>fills</code>, if anyone can help me find out what am I doing wrong?!</p>