Unable to set default column width

Hi AsposeTeam,

We are trying to generate an excel report with default column width of 0.73 inches.
I used the method sheet.getCells().setStandardWidthInch(0.73);
After generating the report, when select all columns and double click on the column separator line the width is defaulting to 0.89 inches.
Is there a way to set default width to custom size?. Please suggest…

Thanks&Regards,
Wizcom Team

Hi there,

Thank you for using Aspose products.

I have evaluated your presented issue while using the latest build of Aspose.Cells for Java 7.6.1.4, whereas the results produced are not expected. Following code should set the default column width to 0.73 inches but when the resultant spreadsheet is loaded in MS Excel, column width is set to 0.77 inches. Please note, I have verified the column width in Page Layout view (View tab, Workbook Views group, Page Layout button) of MS Excel 2010 32-bit edition.


Java


Workbook book = new Workbook();
Worksheet sheet = book.getWorksheets().get(0);
sheet.getCells().setStandardWidthInch(0.73d);
// sheet.getCells().setColumnWidthInch(0, 2.73);
book.save(myDir + “output.xlsx”, SaveFormat.XLSX);

A ticket (CELLSJAVA-40688) has been logged in our bug tracking system to investigate the above discussed behavior in more detail. We will keep you posted with updates in this regard.

Please accept our apologies for your inconvenience.

Hi,

We have fixed this issue.

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

To get the expected result for PageLayout view, please use the following code with the new fix:
e.g.
Sample code:

sheet.setViewType(ViewType.PAGE_LAYOUT_VIEW);

sheet.getCells().setStandardWidthInch(0.73d);

Thank you.

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


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