I am using aspose-cells-8.1.2.jar file to generate excel report.
If my text size is big then i am trying to use autofit methods in the sheet object. but its not working for me.
Please do the needful.
Thanks in advance.
I am using aspose-cells-8.1.2.jar file to generate excel report.
If my text size is big then i am trying to use autofit methods in the sheet object. but its not working for me.
Please do the needful.
Thanks in advance.
Hi Nagesh,
Hi,
Thanks for the immediate reply.
Code snippet:
String temp = "He had said there was evidence against the accused and if the court feels, "
+ "it can take cognisance on closure report in which the agency said that ‘no prosecutable evidence’ "
+ “was found against the company and others, arrayed as accused in its FIR.”;
Range range = worksheets.getRangeByName(“ABC”);
range.setValue(temp);
Style cellStyle = range.getCellOrNull(0, 0).getStyle();
cellStyle.setTextWrapped(true);
AutoFitterOptions autoOptions = new AutoFitterOptions();
options.setAutoFitMergedCells(true);
try {
sheetForm0.autoFitRow(1, 3, 1, 3); // here it is corresponds to cell name given as ‘ABC’
/******** I have tried the following methods also *******/
// sheetForm0.autoFitRows();
// sheetForm0.autoFitRows(options);
// sheetForm0.autoFitRow(2);
// sheetForm0.autoFitRow(2, 1, 3, autoOptions);
// sheetForm0.autoFitRow(2, 1, 3);
// sheetForm0.autoFitRows(false);
// sheetForm0.autoFitRows(true);
// sheetForm0.autoFitRows();
// sheetForm0.autoFitRows(1, 3);
} catch (Exception e) {
e.printStackTrace();
}
Still, I am not able to view the autofit cell in the merged cell(cell name given as ABC).
I tried with aspose-cells-8.3.1.jar also,but not result.
Please help me.
Thanks,
Nageswararao
Hi Nageswararao,
H,
Thanks allot…
But,This code is working for only the merged columns,but not for the merged rows & columns.
Can u please update the code for both merged columns & rows.
Thanks,
Nageswararao
Hi Nageswararao,