We're sorry Aspose doesn't work properply without JavaScript enabled.

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();

    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.


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, dated 6/15/11
Name IBM WebSphere Application Server
Build Level cf191132.09
Build Date 8/13/11
Architecture AMD (64 bit)

Application parameters for start including:

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



Thanks for the screenshot and details.

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

Thank you.