I have problem in the usage of Aspose while building a excel. I am dealing with cells.
I am curretly unable to set column width when contents of a cell begin with a number. To set the column widhth i use:
sheet.getCells().setColumnWidth(0, 10);
sheet.getCells().setColumnWidth(1, 15);
sheet.getCells().setColumnWidth(2, 10);
There is another column with the same style but the contents are string and i am able to set the column width for those columns, but am unable to set the width of a columns whose content is a number or begins with a number.
Please help me in resolving this problem.
regards,
Sandeep
Hi,
I have tried your scenario with the attached latest version/fix using my sample code below, it works absolutely fine with it.
Sample code:
Workbook workbook = new Workbook();
Worksheet sheet = workbook.getWorksheets().addSheet();
Cells cells = sheet.getCells();
//Adding a string value to the cell
Cell cell = cells.getCell(“A1”);
cell.setValue(“123Hello World”);
cell = cells.getCell(“B1”);
cell.setValue(13131344);
cell = cells.getCell(“C3”);
cell.setValue(1.5);
cell = cells.getCell(“D1”);
cell.setValue(“test”);
sheet.getCells().setColumnWidth(0, 10);
sheet.getCells().setColumnWidth(1, 15);
sheet.getCells().setColumnWidth(2, 10);
sheet.getCells().setColumnWidth(3, 10);
workbook.save(“d:\files\output.xls”);
If you still find the issue,with the attached version, do post your sample code and file here.
We will check it soon.
Thank you.