This project is read-only.

Settings a Cell value bold

Sep 8, 2008 at 3:24 PM
I had a look and tried a couple of things with this.

In order to set the values in a cell bold, 3 things needs to happen.

First you need to have a font element in the styles.xml file with a child element <x:b />.

It should look like this:

  <x:b />
  <x:sz val="11" />
  <x:color theme="1" />
  <x:name val="Calibri" />
  <x:family val="2" />
  <x:scheme val="minor" />

Once you have that, you need to reference that font in you CellFormat.
<x:xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0" />

note: evenry attribute listed above references a style.

Once you have a CellFormat, you can tell the Cell which style to use:
<x:c r="A1" s="0" t="s">

the 's' attribute specifies the CellFormat ID.

Where it gets difficult is where you have more than once format specified. You would need to first check which what format the cell is currently using then you need to check what needs to change. You need to check if you need to create a new font, a new CellFormat or if you can use an existing format.

I'm busy working at this, but that is what needs to happen.