I have:
...
//Estilo para el texto normal
HSSFCellStyle estiloNormal = wb.createCellStyle();
estiloNormal.setWrapText(true);
estiloNormal.setVerticalAlignment(HSSFCellStyle.VERTICAL_TOP );
...
String valor1 = "";
String valor2 = "";
...
row.setRowNum((short)3);
cell = row.createCell((short)0);
cell.setCellValue("Direcci�n:");
cell.setCellStyle(style);
cell = row.createCell((short)1);
cell.setCellValue(valor1);
cell.setCellStyle(style);
cell = row.createCell((short)3);
cell.setCellValue(valor2);
cell.setCellStyle(style);
//Creo las celdas combinadas
//sheet.addMergedRegion(new Region(rowFrom,colFrom,rowTo,colTo));
sheet.addMergedRegion(new
Region((int)numeroFila,(short)1,(int)numeroFila,(short)2));
...If valor1 is a long text (i.e.:"kjfsgi difgj dfjgjdsfg jd fj glkdfj lkjdflj lksdjl") setWrapText don't work fine. If valor2 is a long text (i.e.:"kjfsgi difgj dfjgjdsfg jd fj glkdfj lkjdflj lksdjl") setWrapText do work fine. Any suggestion? -----Mensaje original----- De: Purna Chandra Rao Duggirala [mailto:[EMAIL PROTECTED] Enviado el: mi�rcoles, 04 de junio de 2003 11:34 Para: 'POI Users List' Asunto: RE: Merge cell with WrapText=true I am afraid, we can really do this with POI-HSSF, but what we have been doing here is that, we are using merge and then specifying the cell value needed, and it will automatically wrap. but one rider is that, make sure that, the merged region can relly accmodate your cell contents regards, chandoo > -----Original Message----- > From: David Pereira [SMTP:[EMAIL PROTECTED] > Sent: Wednesday, June 04, 2003 2:45 PM > To: lista POI > Subject: Merge cell with WrapText=true > > Hello. > I am trying: > ---------------------- > | | | > ---------------------- > | This is a long text| > | with WrapText=true | > ---------------------- > > but not work. > > In VB code: > ERROR!! > Range("D16:E16").Select > With Selection > .HorizontalAlignment = xlGeneral > .VerticalAlignment = xlBottom > .WrapText = True > .Orientation = 0 > .AddIndent = False > .ShrinkToFit = False > .MergeCells = True <---------------- > End With > > OK!! > Range("D6:E6").Select > With Selection > .HorizontalAlignment = xlCenter > .VerticalAlignment = xlBottom > .WrapText = True > .Orientation = 0 > .AddIndent = False > .ShrinkToFit = False > .MergeCells = False <---------------- > End With > Selection.Merge <---------------- > > How can I do it with HSSF? > > Thanks > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
