Hi,
I am using Aspose.Cell for Java and its version is 2.4.0.1.
I am trying to get the auto-resize the row if the text is
too long to be visible in the cell but unable to do so.
While I was searching in the community I got something like
Workbook wb = new Workbook();
//Note when you create a new workbook, a default
worksheet
//"Sheet1" is added (by default) to the workbook.
//Access the first worksheet "Sheet1" in the book.
Worksheet sheet = wb.getWorksheets().get(0);
sheet.setName("Sample");
//sheet.autoFitRow(0);
Cells cells = sheet.getCells();
cells.setStandardWidthPixels(10);
cells.merge(0, 0, 1, 5);
Cell cell = cells.get(0, 0);
cell.putValue("Check Row Re-sizing");
Style style = cell.getStyle();
style.setTextWrapped(true);
cell.setStyle(style);
AutoFitterOptions autoOptions = new AutoFitterOptions();
autoOptions.setAutoFitMergedCells(true);
try {
sheet.autoFitRows(autoOptions);
sheet.autoFitColumns(autoOptions);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
But the problem is I don't have AutoFitterOptions in my version that I'm using. Could you please suggest me is there a to achieve this in my code.Thanks,
Javeed