poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 49188] autoSizeColumn, ArrayOutOfBounds if more than Short.MAX_VAULE rows
Date Thu, 10 Feb 2011 12:13:42 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=49188

Bhalchandra <b_mekewar@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major

--- Comment #2 from Bhalchandra <b_mekewar@yahoo.com> 2011-02-10 07:13:37 EST ---

following code is failing with same exception : 

    public static void main(String[] args) throws Exception {
        HSSFWorkbook wb = new HSSFWorkbook();
        HSSFSheet sh = wb.createSheet();
        for (int i = 0; i < 65535; i++) {
            HSSFRow row = sh.createRow(i);
            for (int j = 0; j < 3; j++) {
                CellStyle cellStyle = wb.createCellStyle();
                CreationHelper createHelper = wb.getCreationHelper();
               
cellStyle.setDataFormat(createHelper.createDataFormat().getFormat("m/d/yy
h:mm"));
                HSSFCell cell = row.createCell(j);
                cell.setCellStyle(cellStyle);
                Date date = new Date();
                cell.setCellValue("cell[" + i + "," + j + "]");
            }
        }
        for (int j = 0; j < 5; j++) {
            sh.autoSizeColumn(j);
        }
        FileOutputStream fileOut;
        try {
            fileOut = new FileOutputStream("workbook_MaxLimitTest4.xls");
            wb.write(fileOut);
            fileOut.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }
        catch (IOException ie) {
            ie.printStackTrace();
        }
        System.out.println("Done");
    }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


Mime
View raw message