Text is being cropped in table cell

Dear Aspose.
As you can see from example.

When Worksheet is printed, text from table header does not fit into cell and is partially cropped.

Attaching image demonstrating the difference in output:
Bug-1225637-4-Table-Issue-Difference.png (58.1 KB)

Attaching sample application demonstrating the issue:
Bug-1225637-CropTable.zip (124.4 KB)

We have used Windows and latest Aspose.Cells 24.12 to produce the results.

Best Regards
Pavel

@ottap
Through our research, we found that data truncation is caused by automatic row height setting. So you need to call method Worksheet.AutoFitRows(true) to automatically adjust the row height. Please refer to the following API.

Please change the following code:

var sheetRender = new SheetRender(worksheet, imageOptions);

To:

worksheet.AutoFitRows(true);
var sheetRender = new SheetRender(worksheet, imageOptions);

Hope helps a bit.

Thanks for reply. Unfortunately that will not work for our other tables where user do not want to display more then what is seen inside the column with width set as they did.

Since our tool does not know what was intent of user we can not apply this automatic resize to get desired results as we believe that desired results is what user see in excel.

We do not want to apply any transformation to sheet, we would like to get it as is is displayed in Excel.

Thanks for looking.

@ottap,

In your template Excel file, there are rows with the auto (height) attribute (on), which means that when the file is opened in MS Excel manually, the height will adjust automatically. Please note that using AutoFitRows(true) will only modify or increase the height of rows that are with auto tag on, so you can utilize this option (in code) without affecting the height of other rows in the worksheet that are not auto enabled.