Free Support Forum - aspose.com

Incorrect row height after autoFitRows for merged cells

Good day!

We have a problem with auto fit rows for merged cells when cells have multiple lines of text.
For example:
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.

Thanks,
Andrei.

Java for starting web-application:
java version “1.6.0”
Java™ SE Runtime Environment (build pxa6460sr2-20080818_01(SR2))
IBM J9 VM (build 2.4, J2RE 1.6.0 IBM J9 2.4 Linux amd64-64 jvmxa6460-20080816_22093 (JIT enabled, AOT enabled)
J9VM - 20080816_022093_LHdSMr
JIT - r9_20080721_1330ifx2
GC - 20080724_AA)
JCL - 20080808_02

Application server:
WVER0010I: Copyright © IBM Corporation 2002, 2005, 2008; All rights reserved.
WVER0012I: VersionInfo reporter version 1.15.5.1, dated 6/15/11
Name IBM WebSphere Application Server
Version 7.0.0.19
ID BASE
Build Level cf191132.09
Build Date 8/13/11
Architecture AMD (64 bit)

Application parameters for start including:
-Djava.awt.headless=true

OS:
Red Hat Enterprise Linux AS release 4 (Nahant Update 7)

Thanks,
Andrei.

@ADubonos,

Thanks for the screenshot and details.

Could you provide us template Excel file, we will check it soon.

Thank you.