Luciano Greiner wrote:
I've got the same problem... when trying to insert strings with line
breaks it just cut text and show just the part the fits in column.

Thanks

On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Hello everybody,

is it possible to tell a HSSFCell that its content should not extend into the 
next cell but use multiple lines inside the cell as you can do it in Excel?


HSSFWorkbook wb = new HSSFWorkbook();
HSSFCellStyle cellStyle = wb.createCellStyle();
cellStyle.setWrapText(true);

HSSFSheet sheet = wb.createSheet();
HSSFRow row = row = sheet.createRow((short)0);
HSSFCell cell = row.createCell((short)0)
cell.setCellStyle(cellStyle);
cell.setCellValue(
  new HSSFRichTextString(" Line 1 \n Line2 ");
);

Will produce a cell where the text will wrap at the line break.

Cheers,
Rc
--
Richard Cote
Software Engineer - PRIDE Project Team (Sequence Database Group)
European Bioinformatics Institute
Wellcome Trust Genome Campus                 [EMAIL PROTECTED]
Hinxton, Cambridge CB10 1SD                  Phone: (+44) 1223 492610
United Kingdom                               Fax  : (+44) 1223 494468

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to