Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > problem with poi and row height

Thread Tools

problem with poi and row height
Posts: n/a
hello everybody,
I using POI to generate some report, and here my problem with my code:

row.createCell((short)2);HSSFUtils.createCell(row, (short)2,
CoordResponsable, cellStyle);
HSSFUtils.mergeCell(sheet, 8+i, (short)2, (short)4, cellStyle,

with the function:
public static void mergeCell(HSSFSheet sheet, int iRow, short
short endCell, HSSFCellStyle style, String value) {
HSSFRow row = sheet.getRow(iRow);
if (row==null) {
sheet.addMergedRegion(new Region(iRow, startCell, iRow, endCell));
if (style!=null) {
if (value!=null) {

public static HSSFCell createCell(HSSFRow row, short iPos, String
value, HSSFCellStyle cellStyle) {
HSSFCell cell = row.createCell(iPos);
return cell;

in my cellstyle i have cellStyle.setWrapText(true);

when i do :
HSSFUtils.mergeCell(sheet, 8+i, (short)2, (short)4, cellStyle,

my variable CoordResponsable is a string with many line
but the merged cell doesn't fit the data(the data are in the cell but
you can only see the first line and you have to click on the cell to
see all, I would like the row's height fit automatically with the
number of line)

any idea?
thanks in advance

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
measuring web controls height at runtime (or converting .height % to px) Wotney ASP .Net 1 10-25-2006 01:39 PM
how to get specific cell height without hard-coding a height value HTML 0 08-19-2006 08:13 PM
ok I can do a totals row but how about a percentage row after each data row D ASP .Net Datagrid Control 0 05-23-2005 04:10 PM
1em height row in IE (spanned row) W@cek HTML 0 03-31-2005 11:23 AM
problem with poi, XML and sorting excel file [XaToA] Java 0 07-29-2003 12:39 PM