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

Free Support Forum - aspose.com

Unhide Row with previously assigned height

Hi.


I have found, that i have a way to restore column’s width after unhiding.
http://www.aspose.com/docs/display/cellsnet/Hiding+Unhiding+Rows+and+Columns

cells.unhideColumn(index, -1)

I have tried to make unhideRow with negative height and catched exception
com.aspose.cells.CellsException: Row height must be between 0 and 409.

There is exists a way to unhideRow with previously assigned height?

Best regards. Alexey

Hi,


Well, we only supported to unhhide a column to previously assigned width. Regarding unhide a row to its previously assigned height, it is not supported but we may look into it for your needs. Could you give us your template Excel file here, we may try to analyze it if we can support it. We may log a ticket into our database as well.

Thank you.

Hi. Sorry for delay. There is test case (that at this moment are failed) and template.


Also i have sight that height of row are differentm that display Excel. I have added asserts for each height and they always different.

Value, that i have set in Excel - Value, that had a row in Aspose
80 - 80.1
34 - 33.9
15.5 - 15.6

Do you known a way for fix it?


Code sample:

@Test
public void unhideRow() {
try {
Workbook wbk=new Workbook(“D:\AsposeTest.xls”);

Cells cells = wbk.getWorksheets().get(0).getCells();

System.out.println(cells.getRowHeight(2));
System.out.println(cells.getRowHeight(3));
System.out.println(cells.getRowHeight(4));

assertEquals(80, cells.getRowHeight(2));
assertEquals(34, cells.getRowHeight(3));
assertEquals(15.5, cells.getRowHeight(4));

cells.hideRow(2);
cells.hideRow(3);
cells.hideRow(4);

cells.unhideRow(2, -1);
cells.unhideRow(3, -1);
cells.unhideRow(4, -1);

System.out.println(cells.getRowHeight(2));
System.out.println(cells.getRowHeight(3));
System.out.println(cells.getRowHeight(4));

assertEquals(80, cells.getRowHeight(2));
assertEquals(34, cells.getRowHeight(3));
assertEquals(15.5, cells.getRowHeight(4));

} catch (Exception e) {
e.printStackTrace();
}
}

Hi Alexey,

Thank you for sharing your sample spreadsheet and code snippet.

We are able to observe the problem of incorrect row height while using the latest version of Aspose.Cells for Java 7.7.0.4. A ticket has been logged in our bug tracking system for further investigation and correction purposes. The ticket Id for your future reference is CELLSJAVA-40709.

As discussed earlier, we have currently implemented the feature of restoring the Column width to its previous size by passing a negative value as second parameter to the Cells.unhideColumn method. We have now logged a ticket to provide an equivalent feature for Rows as well. The ticket Id in this reference is CELLSJAVA-40708.

Please spare us little time to properly analyze the both mentioned issues in more detail. In the meanwhile, we will keep you posted with updates.

Hi Alexey,

Thanks for using Aspose.Cells.

If the resolution of screen is 96, the stored height of Row 3 is 80.01
points (106.8 pixels) in the file, but MS Excel showed the row height in unit of
Pixels, so the row height is 106 pixels (79.5 points).

If the resolution is
changed, you will get different row height in Ms Excel.

So please directly
use Cells.GetRowHeightPixel(int row) method.

Hi Shakeel Faiz.


Thanks for help.

Best regards. Alexey

Hi,

Please download and try our latest fix/version: Aspose.Cells for Java v7.7.1.3


For CELLSJAVA-40708, now you can use -1 for the “height” parameter of the method Cells.unhideRow(int row, double height) and Cells.unhideRows(int row,
int totalRows,double height) to restore row height to previous size when
unhiding row.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-40708) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.