We have a problem with auto fit rows for merged cells when cells have multiple lines of text.
Cell has 3 lines (and has height 36.00). After calling Worksheet.autoFitRows the row (which contains this cell) has height 24.00. So, the last line of the cell is invisible for user, when he open saved Excel-file in MS Office. User must stretch this row by hand.
We have the same result if we set new long text value to this cell (by Java-code), and call Worksheet.autoFitRows after that.
Flag “Text wrapped” is on for this merged cells.
Screenshot of result xls-file is attached (look at cell “L12”): screenshot_01.png (18.1 KB)
We are using the code like this:
final InputStream inputStream = obtianInputStream(); final Workbook workbook = new Workbook(inputStream); final Worksheet worksheet = workbook.getWorksheets().get(0); final AutoFitterOptions fitterOptions = new AutoFitterOptions(); fitterOptions.setAutoFitMergedCells(true); fitterOptions.setIgnoreHidden(true); fitterOptions.setOnlyAuto(false); worksheet.autoFitRows(fitterOptions); final OutputStream outputStream = obtainOutputStream(); workbook.save(outputStream, FileFormatType.EXCEL_97_TO_2003);
We are using Aspose.Cells 17.6
Language in the xls-file: Russian.
Font directory is set for Aspoce.Cells, and it contains .ttf file for Times New Roman font.