java-ee - java导出excel,修改写死界面的内容
怪我咯
怪我咯 2017-04-18 10:53:48
0
1
832

我现在想修改导出Excel的部分界面。
下图是现在的界面,左边的使用说明是写死的,数据源是动态生成的,我现在只需要修改使用说明就好了。

这个是修改后变成的样子

部分后端代码

 private ExcelExport<WarehouseInventoryTask> prepayExport(List<WarehouseInventoryTask> list) {
        ExcelExport<WarehouseInventoryTask> excelExport = new ExcelExport<WarehouseInventoryTask>();
        excelExport.setSheetName(SeaxConstants.EXCEL_SHEET_NAME_COMPANY);
        excelExport.setHeaders(HEADERS);
        excelExport.setGetterMethodName(GETTER_METHOD_NAME);
        excelExport.setColumnWidth(COLUMN_WIDTH);
        excelExport.setDataset(list);
        excelExport.setList(InventoryExcelDescribe.getList());//得到使用说明的界面

        return excelExport;
    }
    

InventoryExcelDescribe类:

 ONE(1,"xxxx"),
TWO(2,"xxxx"),
THREE(3,"xxx"),
FOUR(4,"xxx"),
FIVE(5,"xxx"),
SIX(6,"xxx"),
SEVEN1(7,"  xxx黄色标示提醒"),
SEVEN2(8,"   xxx绿色标示提醒;"),
SEVEN3(9,"   xxx红色标示提醒"),
SEVEN4(10,"  xxx"),
SEVEN5(11,"  xxx"),
EIGHT(12,"xxx"),
NINE(13,"xxx");

    private String name;
    private int code;
      public static List getList() {
            List<EnumObj> list = new ArrayList<>();
            for (InventoryExcelDescribe em : InventoryExcelDescribe.values()) {
                EnumObj obj = new EnumObj();
                obj.setId(em.getCode());
                obj.setName(em.getName());
                list.add(obj);
            }
            return list;
        }

那么我现在这么在原来的基础上加上3个单元格(7.8.9右边的单元格),且各自都有背景色(固定位置的)?

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(1)
阿神

Recommend a framework EasyPoi to see if it can solve the problem

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template