title: The styles of the spreadsheet are not working
body: <p>I'm trying to add some styles to some cells in a generated spreadsheet.</p>
  
  <pre><code>private static Stylesheet CreateStylesheet()
      {
          Stylesheet stylesheet = new Stylesheet();
  
          Fonts fonts = new Fonts();
          fonts.Append(
              new DocumentFormat.OpenXml.Spreadsheet.Font(
                  new Bold(),
                  new FontSize() { Val = 10 },
                  new DocumentFormat.OpenXml.Spreadsheet.Color() { Rgb = new HexBinaryValue() { Value = "000000" } },
                  new FontName() { Val = "Arial Narrow" }
              )
          );
          fonts.Append(
              new DocumentFormat.OpenXml.Spreadsheet.Font(
                  new FontSize() { Val = 10 },
                  new DocumentFormat.OpenXml.Spreadsheet.Color() { Rgb = new HexBinaryValue() { Value = "000000" } },
                  new FontName() { Val = "Arial Narrow" }
              )
          );
          fonts.Append(
              new DocumentFormat.OpenXml.Spreadsheet.Font(
                  new Bold(),
                  new FontSize() { Val = 12 },
                  new DocumentFormat.OpenXml.Spreadsheet.Color() { Rgb = new HexBinaryValue() { Value = "000000" } },
                  new FontName() { Val = "Arial Narrow" }
              )
          );
          fonts.Append(
              new DocumentFormat.OpenXml.Spreadsheet.Font(
                  new Bold(),
                  new FontSize() { Val = 14 },
                  new DocumentFormat.OpenXml.Spreadsheet.Color() { Rgb = new HexBinaryValue() { Value = "000000" } },
                  new FontName() { Val = "Arial Narrow" }
              )
          );
  
          stylesheet.Fonts = fonts;
  
          Fill fill3 = new Fill();
          PatternFill patternFill3 = new PatternFill() { PatternType = PatternValues.Solid };
          ForegroundColor foregroundColor1 = new ForegroundColor() { Rgb = "FFFF0000" };
          BackgroundColor backgroundColor1 = new BackgroundColor() { Indexed = (UInt32Value)64U };
          patternFill3.Append(foregroundColor1);
          patternFill3.Append(backgroundColor1);
          fill3.Append(patternFill3);
  
          Fills fills = new Fills();
          fills.Append(
              new Fill(
                  new PatternFill() { PatternType = PatternValues.None }
              )
          );
  
          fills.Append(fill3);
  
          stylesheet.Fills = fills;
  
          Borders borders = new Borders();
          borders.Append(new Border());
          borders.Append(
              new Border(
                  new LeftBorder(),
                  new RightBorder(),
                  new TopBorder(),
                  new BottomBorder()
              )
          );
  
          stylesheet.Borders = borders;
  
          NumberingFormats numberingFormats = new NumberingFormats();
  
          NumberingFormat currencyFormat = new NumberingFormat();
          currencyFormat.NumberFormatId = UInt32Value.FromUInt32(3453);
          currencyFormat.FormatCode = StringValue.FromString("###,0 €");
          numberingFormats.Append(currencyFormat);
          stylesheet.NumberingFormats = numberingFormats;
  
          CellFormats formats = new CellFormats();
          formats.Append(new CellFormat
          {
              FontId = 1U,
              FillId = 0U,
              BorderId = 1U,
              ApplyFont = true,
              ApplyAlignment = true,
              Alignment = new Alignment()
              {
                  Horizontal = HorizontalAlignmentValues.Center,
                  Vertical = VerticalAlignmentValues.Center
              }
          });
          formats.Append(new CellFormat
          {
              FontId = 2U,
              BorderId = 1U,
              ApplyFont = true,
              Alignment = new Alignment()
              {
                  Horizontal = HorizontalAlignmentValues.Left,
                  Vertical = VerticalAlignmentValues.Center
              }
          });
          formats.Append(new CellFormat
          {
              FontId = 1U,
              FillId = 0U,
              BorderId = 0U,
              NumberFormatId = currencyFormat.NumberFormatId,
              ApplyFill = true,
              ApplyFont = true,
              ApplyBorder = true,
              ApplyNumberFormat = true
          });
          formats.Append(new CellFormat
              {
                  FontId = 0U,
                  FillId = 0U,
                  BorderId = 0U,
                  ApplyFont = true
              }
          );
          formats.Append(new CellFormat
              {
              FontId = 3U,
              FillId = 0U,
              BorderId = 0U,
              ApplyFont = true
              }
          );
  
          stylesheet.CellFormats = formats;
  
          return stylesheet;
      }
  </code></pre>
  
  <p>I need to apply some of this styles to the cells that are inserted in the sheet. I am assuming that cell formats are the available styles. Am i doing something wrong here?</p>
  
  <p>This code only creates the stylesheet.</p>
  
  <p>I'm using the following assembly: DocumentFormat.OpenXml (version 2.7.1)
  It was obtained from the source: <a href="https://github.com/OfficeDev/Open-XML-SDK" rel="nofollow noreferrer">https://github.com/OfficeDev/Open-XML-SDK</a></p>
  
  <p>After defining the stylesheet, i create a cell with a code similar to this:</p>
  
  <pre><code>Cell cell = InsertCellInWorksheet(workSheet, addressName, 0U);
  cell.CellValue = new CellValue(value);
  cell.DataType = new EnumValue&lt;CellValues&gt;(CellValues.Number);
  cell.StyleIndex = 1U;
  </code></pre>