poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aram Mirzadeh <...@mbcli.com>
Subject Odd behavior in POI 3.10-beta1 & java7
Date Wed, 11 Dec 2013 19:17:19 GMT

I have this method for a number of years and I think when I upgaded to 
3.10-beta1 I started to see this odd behavior.   I'm also running 64-bit 
jdk build 1.7.0_25-b17, in eclipse Juno (64bit) on windows 7 (64bit).

The first 15 rows (all columns), the text of the cell is replaced with a 
numeric value, it's the same value each time but I can't figure out 
where it's coming from.

Commenting out the cell.setCellType(Cell.CELL_TYPE_NUMERIC); does indeed 
fix the problem.

Any ideas?

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.util.CellRangeAddress;
....
/**
      * Create the data sheet based on the sheet name and the sql provided
      *
      * @param sheetName
      * @param result
      * @throws SQLException
      */
/*
     colcount = 16
     result.length = 44
     row 1 = header
     sheetname.length=30
     all xssf
/*
     public void createDataSheet (Workbook wb, String sheetName, 
Result<?> result) throws SQLException {
         int colCount = 0;
         Sheet s = wb.createSheet(sheetName);
         logger.log(Level.DEBUG, String.format("Working on sheet %s for 
%s.",productName, sheetName));
         colCount = buildSheet(s, result);
         CellRangeAddress cra = new CellRangeAddress(0, 0, 0, colCount);
         logger.log(Level.TRACE, "Creating auto filter...");
         s.setAutoFilter(cra);
         for (int i = 0; i < colCount; i++) {
             s.autoSizeColumn(i);
             if (s.getColumnWidth(i) > 20) s.setColumnWidth(i, 20 * 256);
             Row row = getRow(wb.getSheet(sheetName), i);
             for (int j = 0; j < result.size(); j++) {
                 Cell cell = getCell(row, j);
/****
                 cell.setCellType(Cell.CELL_TYPE_NUMERIC);
*****/
             }
         }
         logger.log(Level.TRACE, "Finished createDataSheet.");
     }




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Mime
View raw message