Why is my style not being applied to my range (Aspose Cells)?

584 views Asked by At

I am creating a range, giving it a value, and styling it up like so:

private string fontForSheets = "Calibri";

Range unitNameRange = locationWorksheet.Cells.CreateRange("A1", "D1");

unitNameRange.PutValue(_unit, false, true); // val, isConverted, SetStyle. Don't know if these bools are right...
CellsFactory cf = new CellsFactory();
Style style = cf.CreateStyle();
style.HorizontalAlignment = TextAlignmentType.Left;
style.Font.Name = fontForSheets;
style.Font.IsBold = true;
style.Font.Size = 14;
unitNameRange.SetStyle(style);

But the style is not "taking" - the value is a simple, generic, bit of text; it is Arial 10, no bolding. How can I get the style to adhere to the range?

Is either the second or third, or both, wrong? I was guessing when setting isConverted to false and SetStyle to true...

1

There are 1 answers

2
shakeel On BEST ANSWER

Please check the reply related to this issue at the following Aspose.Cells forum.

Note: I am working as Developer Evangelist at Aspose