Interesting that this exists at all... However, I have older code agnostic of that feature anyway, and there I collect the sizes by-column and apply them using a factor, since the original size width value returned by single cells is too small anyway compared to what seems to be needed for applying it as column width.
With grouping characters switched on, this is too small either, but for text content it works. Reasonably I should distinguish between numeric cells with million values and grouping characters on the one hand and text values on the other. But in a table generating servlet handling very general requests for lists, that is not always easy. Regards, -- Dipl.-Inform. Christian Gosch Systems Development inovex GmbH Karlsruher Strasse 71 D-75179 Pforzheim Tel: 07231 3191-85 Fax: 07231 3191-91 [EMAIL PROTECTED] www.inovex.de Sitz der Gesellschaft: Pforzheim AG Mannheim, HRB 502126 Geschäftsführer: Stephan Müller > -----Original Message----- > From: Ruchi Agrawal [mailto:[EMAIL PROTECTED] > Sent: Sunday, September 14, 2008 1:59 PM > To: [email protected] > Subject: POI Automatic column sizing > > Hello All, > I am trying to work on automatic sizing of columns in POI. I am trying to > do this per column once all my data is generated. The data in one of the > columns is date time and since it is larger than the cell width it shows > as "#######" when i open excel. The below code des not work at all int his > case. Can some please provide any help. > HSSFRow row = sheet.getRow(1); > java.util.Iterator<HSSFCell> it = row.cellIterator(); > while(it.hasNext()){ > HSSFCell cell = it.next(); > sheet.autoSizeColumn((short)cell.getCellNum()); > } > > > > > !DSPAM:48ccfd0622935979182995! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
