Nobody has any suggestions or ideas about what's going on here?



On 12/12/2013 4:29 PM, David kerber wrote:
Running poi 3.10 beta 2, downloaded last week.

I'm trying to set the style for an entire row using row.setRowStyle(
HSSFCellStyle ), and it's not working.  "Not working" means it simply
doesn't apply the style to any of the cells of the row.  The cell
content is still there.

This works, by setting the style on each cell individually:

public void writeXlsLine( HSSFSheet sheet, Object[] line, HSSFCellStyle
rowStyle, short rowHeight ) {
     HSSFRow row = sheet.createRow( xlsLine );
     row.setHeightInPoints( rowHeight );
     int colNum = 0;
     for ( Object thisObj : line ) {
         HSSFCell cell = row.createCell( colNum ++ );
         if ( thisObj instanceof String ) {
             cell.setCellValue( (String) thisObj );
         } else if ( thisObj instanceof Double ) {
             cell.setCellValue( (Double) thisObj );
         } else if ( thisObj instanceof Integer ) {
             cell.setCellValue( (Integer) thisObj );
         }
     }


for ( Cell thisCell : row ) {
     thisCell.setCellStyle( rowStyle );
}


But replacing the 3-stmt block of code above with:

     row.setRowStyle( rowStyle );


Does nothing.  Is it supposed to?  Or am I missing something in how it
works.

Dave

---------------------------------------------------------------------
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]

Reply via email to