有关导出excel表格的问题,代码如下,导出的excel表格里面没有数据,list集合不为空。

 @RequestMapping("export")
    public void export(BuchangAnzhiViewRequest req, HttpServletResponse response)
            throws IOException, InstantiationException, IllegalAccessException
    {
        List<BuchangAnzhiView> viewList = getBuchangAnzhiViews(req, req.getPage());

        Workbook wb = getWorkbook("/template/buchanganzhi.mingxi.export.xlsx");

        Sheet sheet = wb.getSheetAt(0);

        if(CollectionUtils.isNotEmpty(viewList)){

            for(int i=0; i < viewList.size(); i++){

                Row row = sheet.createRow(i+2);

                BuchangAnzhiView view = viewList.get(i);
                int column =  0;
                setCell(row, column++, view.getBatchNo());
                setCell(row, column++, view.getRelocateNo());
                setCell(row, column++, view.getRelocateName());
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getHouseMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getDecorationMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getAttachmentMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getMoveMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getTransitionCost()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getAgreementAward()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getSubmitAward()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getOtherCompensate()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getTotalCompensate()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getBuildingPrice()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getFloorBalance()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getSettlementPrice()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getGaragePrice()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getGarageMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getTotalHouseMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getMaintainMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getSettlementBalance()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getOtherMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getTotalMoney()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getTemporaryDeposit()));
                setCell(row, column++, wb, MoneyUtils.formatBigDecimalMoney2String(view.getTotalGetMoney()));
            }
        }

        response.setContentType("application/vnd.ms-excel");
        response.setHeader("Content-Disposition", "attachment; filename=" + encodeFileName("拆迁项目补偿安置情况明细查询表-" + CzyszjUtil.getCurrentYYYYMMDD() +".xlsx"));
        ServletOutputStream out = response.getOutputStream();
        wb.write(out);
        out.flush();
    }

http://blog.csdn.net/zhuangjixiang/article/details/8998206