poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54443] ClassCastException in HSSFOptimiser
Date Thu, 17 Jan 2013 15:19:06 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54443

--- Comment #2 from Hakan Junior <javaguru.hakan@gmail.com> ---
Hi,
The excel file is generating in memory. Here is the approach;
        for (int i = 0; i < 6; i++)
            excelAPI.setCellValue(0, i, 1, "ROW " + i);
        excelAPI.setCellFontBoldProp(0, 2, 1, true);
        excelAPI.setCellBackgroundColor(0, 2, 1, ExcelAPIConstants.COLOR_BLUE);
        excelAPI.setCellBackgroundColor(0, 0, 1, ExcelAPIConstants.COLOR_RED);

        excelAPI.groupAndOutlineRows(0, 30, 70, true);
        excelAPI.groupAndOutlineRows(0, 2, 25, true);
        //excelAPI.mergeCells(0, 0, 1, 4);

        excelAPI.setCellFontBoldProp(0, 5, 1, true);
        excelAPI.setCellFontItalicProp(0, 5, 1, true);

        excelAPI.setCellHyperlink(0, 0, 3, "TIKLAA",1,2,2);

        for (int i=0;i<15000;i++){
            excelAPI.setCellValue(1, i, 0, "De─čer : "+i,
i%3==0?ExcelAPIConstants.ALIGNMENT_HORIZONTAL_RIGHT:ExcelAPIConstants.ALIGNMENT_HORIZONTAL_LEFT);
            excelAPI.setCellFontBoldProp(1, i, 0, i%5==0);
            excelAPI.setCellFontItalicProp(1, i, 0, i%4==0);
            excelAPI.setCellBackgroundColor(1, i, 0,
i%25==0?ExcelAPIConstants.COLOR_RED:(i%4==0?ExcelAPIConstants.COLOR_BLUE:ExcelAPIConstants.COLOR_GREEN));
        }

        excelAPI.closeExcelFile(true, false);

excelApi is a wrapper of HSSF POI APis

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