Why is my background color not applied?

I'm trying to add a color to the background of my cells like so:

style.BackgroundColor = Color.LightBlue;
style.Pattern = BackgroundType.Solid;

In more context:

Cell shortNameHeaderCell = locationWorksheet.Cells[BYDCBYLOC_HEADING_ROW, SHORTNAME_BYDCBYLOC_COL];
shortNameHeaderCell.PutValue("Short Name");
style = cf.CreateStyle();
style.HorizontalAlignment = TextAlignmentType.Left;
style.VerticalAlignment = TextAlignmentType.Center;
style.Font.Name = fontForSheets;
style.Font.IsBold = true;
style.Font.Size = 12;
style.BackgroundColor = Color.LightBlue;
style.Pattern = BackgroundType.Solid;
shortNameHeaderCell.SetStyle(style);
Cell companyNameHeaderCell = locationWorksheet.Cells[BYDCBYLOC_HEADING_ROW, COMPANYNAME_BYDCBYLOC_COL];
companyNameHeaderCell.PutValue("Company Name");
companyNameHeaderCell.SetStyle(style);
Cell reasonDescHeaderCell = locationWorksheet.Cells[BYDCBYLOC_HEADING_ROW, REASONDESC_BYDCBYLOC_COL];
reasonDescHeaderCell.PutValue("Reason Description");
reasonDescHeaderCell.SetStyle(style);
Cell transTypeHeaderCell = locationWorksheet.Cells[BYDCBYLOC_HEADING_ROW, TRANSTYPE_BYDCBYLOC_COL];
transTypeHeaderCell.PutValue("Transaction Type");
style = cf.CreateStyle();
style.HorizontalAlignment = TextAlignmentType.Center;
style.Font.Name = fontForSheets;
style.Font.IsBold = true;
style.Font.Size = 12;
style.IsTextWrapped = true;
style.BackgroundColor = Color.LightBlue;
style.Pattern = BackgroundType.Solid;
transTypeHeaderCell.SetStyle(style);
Cell sumOfQtyOrdHeaderCell = locationWorksheet.Cells[BYDCBYLOC_HEADING_ROW, QTYORD_BYDCBYLOC_COL];
sumOfQtyOrdHeaderCell.PutValue("Sum of Qty Ord");
sumOfQtyOrdHeaderCell.SetStyle(style);
Cell sumOfQtyShippedHeaderCell = locationWorksheet.Cells[BYDCBYLOC_HEADING_ROW, QTYSHIPPED_BYDCBYLOC_COL];
sumOfQtyShippedHeaderCell.PutValue("Sum of Qty Shipped");
sumOfQtyShippedHeaderCell.SetStyle(style);

Yet, the light blue color is not applied, as shown by the screenshot.

Something is happening, though, because it looks like the midsections of the vertical lines bounding the cells have been erased. I don't know why, or what if any connection that has with the unbearable invisibleness of the light blue color. Before adding that code (first snippet), those smudges/erasings were not [in]visible.

[1]: https://i.stack.imgur.com/LEweA.png

Hi Clay,


Thank you for contacting Aspose support.

Please try the following piece of code that paints the cell A1 with light blue color. Please amend the code based on this snippet and give the scenario another try. In case the problem persists, please share an executable sample application along with the used template spreadsheet for review.

C#

var book = new Workbook(dataDir + “book1.xlsx”);
var locationWorksheet = book.Worksheets[0];
Style style = null;
CellsFactory cf = new CellsFactory();
Cell transTypeHeaderCell = locationWorksheet.Cells[0, 0];
transTypeHeaderCell.PutValue(“Transaction Type”);
style = cf.CreateStyle();
style.HorizontalAlignment = TextAlignmentType.Center;
style.Font.Name = “Arial”;
style.Font.IsBold = true;
style.Font.Size = 12;
style.IsTextWrapped = true;
style.ForegroundColor = Color.LightBlue;
style.Pattern = BackgroundType.Solid;
transTypeHeaderCell.SetStyle(style);
book.Save(dataDir + “output.xlsx”);