Hello. I have an issue concerning the height of a row before and after I increase the font size of a cell with content in the row. In my code below I do this:
- I enter some text into cell “A1”.
- Output the height of row “1:1”. Displays 12.75
- Increase the font size of cell “A1”.
- Output the height of row “1:1” again. Displays 12.75 but I expect it to display 25.5.
The problem here is that after increasing the font size, the row height should also increase. This is what happens if I do this directly in Excel. If I open the generated file after running this code, the row height is clearly larger than any other row (See attached image)
Is this a bug in the Aspose.Cells code? What is the work-around for this? Here’s my code that replicates this:
static void Main(string[] args)
{
const string filename = @“pathToFile”;
var workbook = new Workbook();
var cells = workbook.Worksheets[0].Cells;
var row = cells.Rows[0];
var cell = cells[0, 0];
cell.Value = “Hello World”;
Console.WriteLine(row.Height); //12.75
var style = cell.GetStyle();
style.Font.Size = 20;
cell.SetStyle(style);
Console.WriteLine(row.Height); //12.75 (should be 25.5)
workbook.Save(filename);
Console.WriteLine(“press enter”);
Console.ReadLine();
}