You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2011/02/10 13:13:42 UTC

DO NOT REPLY [Bug 49188] autoSizeColumn, ArrayOutOfBounds if more than Short.MAX_VAULE rows

https://issues.apache.org/bugzilla/show_bug.cgi?id=49188

Bhalchandra <b_...@yahoo.com> changed:

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

--- Comment #2 from Bhalchandra <b_...@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