Veröffentlicht 15. November 200618 j Hi Leute, ich suche etwas womit ich nen Automatischen Zeilenumbruch schalten kann! Irgendwie finde ich nichts in der Poi Bibliothek. D.h. er befüllt mir automatisch meine Spalten in einem Excel sheet, er soll dann automatisch umbrechen, wenn der Satz oder das Wort zulange ist für die Spalte! siehe Bild: (da soll er umbrechen) Kann mir da jemand helfen? DANKE MFG MIKE
15. November 200618 j Using newlines in cells HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet s = wb.createSheet(); HSSFRow r = null; HSSFCell c = null; HSSFCellStyle cs = wb.createCellStyle(); HSSFFont f = wb.createFont(); HSSFFont f2 = wb.createFont(); cs = wb.createCellStyle(); cs.setFont( f2 ); //Word Wrap MUST be turned on cs.setWrapText( true ); r = s.createRow( (short) 2 ); r.setHeight( (short) 0x349 ); c = r.createCell( (short) 2 ); c.setCellType( HSSFCell.CELL_TYPE_STRING ); c.setCellValue( "Use \n with word wrap on to create a new line" ); c.setCellStyle( cs ); s.setColumnWidth( (short) 2, (short) ( ( 50 * 8 ) / ( (double) 1 / 20 ) ) ); FileOutputStream fileOut = new FileOutputStream( "workbook.xls" ); wb.write( fileOut ); fileOut.close();
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.