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

Simon Tan <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 OS|                            |All

--- Comment #5 from Simon Tan <[email protected]> ---
1.Confirm  is POI's problem, i use Java Excel API , works fine!

public static void generateAmSch001Report(String buName, String reportFile,
List<ExampleVO> voList) {
        File srcFile = new File("template.xls");
        File destFile = new File("destFile.xls");
        try {
            Workbook wb = Workbook.getWorkbook(srcFile);
            WritableWorkbook wwb = Workbook.createWorkbook(destFile, wb); 
            WritableSheet wws = wwb.getSheet(0);
            int rowNum = 9;
            if (null != voList) {
                rowNum = 12;
                int sn = 1;
                WritableCellFormat wcs = new WritableCellFormat();
                wcs.setBorder(jxl.format.Border.ALL,
jxl.format.BorderLineStyle.THIN);
                for (ExampleVO vo : voList) {
                    int colNum = 1;
                    label = new Label(colNum++, rowNum,  "", wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  sn + "", wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  vo.getAt(), wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  "", wcs);
                    wws.addCell(label);
                    label = new Label(colNum++, rowNum,  "", wcs);
                    wws.addCell(label);
                    rowNum++;
                    sn++;
                }
            }
            wwb.write(); 
            wwb.close();
            wb.close();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (RowsExceededException e) {
            e.printStackTrace();
        } catch (WriteException e) {
            e.printStackTrace();
        } catch (BiffException e) {
            e.printStackTrace();
        }
    }

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to