Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 89754 invoked from network); 6 Jun 2006 22:47:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 6 Jun 2006 22:47:32 -0000 Received: (qmail 44128 invoked by uid 500); 6 Jun 2006 22:47:30 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 44108 invoked by uid 500); 6 Jun 2006 22:47:30 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 44097 invoked by uid 99); 6 Jun 2006 22:47:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 15:47:30 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [68.120.122.90] (HELO CPMAL00.paymentone.com) (68.120.122.90) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Jun 2006 15:47:29 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: Multi line text Date: Tue, 6 Jun 2006 15:47:09 -0700 Message-ID: <3F243AF6C4C61A42A80C9AECF3A4018501DD9EFE@cpmal00.corpnet.p1.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Multi line text Thread-Index: AcaJujy5Xbwfj7rNQu2nW11Stek05wAAMcgw From: "Nidhi Tuli" To: "POI Users List" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N You can look at http://jakarta.apache.org/poi/hssf/quick-guide.html Using newlines in cells HSSFWorkbook wb =3D new HSSFWorkbook(); HSSFSheet s =3D wb.createSheet(); HSSFRow r =3D null; HSSFCell c =3D null; HSSFCellStyle cs =3D wb.createCellStyle(); HSSFFont f =3D wb.createFont(); HSSFFont f2 =3D wb.createFont(); cs =3D wb.createCellStyle(); cs.setFont( f2 ); //Word Wrap MUST be turned on cs.setWrapText( true ); r =3D s.createRow( (short) 2 ); r.setHeight( (short) 0x349 ); c =3D 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 =3D new FileOutputStream( "workbook.xls" ); wb.write( fileOut ); fileOut.close(); Hope this helps Nidhi -----Original Message----- From: Meghana [mailto:sy62k@yahoo.com]=20 Sent: Tuesday, June 06, 2006 3:40 PM To: poi-user@jakarta.apache.org Subject: Multi line text Hi, Does any one know how to out put the text in multiple lines in a cell? In each row only two cells will have large text running into multiple lines.=20 Any help is appreciated, Thanks, -M __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around=20 http://mail.yahoo.com=20 --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/