Hi world,
I'm writing excel files with HSSF libraries and it works very well.
Nevertheless, I think I have misunderstood something about HSSF styles. I'm
afraid they're only available when java is running. Or is it possible to
save them in the excel result, with a nice name, so that the excel user can
modify the applied style ? If could there be a workaround ?
Here is a sample program :
HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet =
wb.createSheet("new sheet"); HSSFRow row = sheet.createRow((short)0);
HSSFCell cell = row.createCell((short)0); cell.setCellValue(1);
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setBorderBottom(cellStyle.BORDER_THICK); cell =
row.createCell((short)0); cell.setCellValue(1);
cell.setCellStyle(cellStyle); FileOutputStream fileOut = new
FileOutputStream("workbook.xls"); wb.write(fileOut);
fileOut.close();workbook.xls contains a cell with the expected formatting
properties, but its style is 'normal'.Thanks,Ghislain
Massimo Dell'Andrea - 29 Sep 2005 10:58 GMT
> Hi world,
> I'm writing excel files with HSSF libraries and it works very well.
[quoted text clipped - 14 lines]
> fileOut.close();workbook.xls contains a cell with the expected formatting
> properties, but its style is 'normal'.Thanks,Ghislain
Try using HSSFCellStyle.BORDER_THIN
Ghislain Benrais - 29 Sep 2005 11:22 GMT
Thanks Massimo but the program works ! I get the border I expected. The
trouble is that the cell doesn't have its own style. So suppose I have
thousands of cells with this style, how could the excel user change its
formatting properties.
>> Hi world,
>> I'm writing excel files with HSSF libraries and it works very well.
[quoted text clipped - 16 lines]
>
> Try using HSSFCellStyle.BORDER_THIN
Ghislain Benrais - 30 Sep 2005 10:56 GMT
Well, I'm afraid it's not possible to retrieve styles according to :
http://issues.apache.org/bugzilla/show_bug.cgi?id=35498