0

在我的程序中

Map<String, Collection<Employee>> beans = new HashMap<String, Collection<Employee>>();
        beans.put("employee", staff);
        XLSTransformer transformer = new XLSTransformer();
        try {
            transformer.transformXLS("C:/Users/hussain.a/Desktop/newprojectpocdetails/temp (Autosaved).xls", beans, "C:/Users/hussain.a/Desktop/newprojectpocdetails/demo.xls");

我正在设置单元格公式,例如 ${employee.field1} ,${employee.field2} 并且它工作正常

但是在接下来的几列中,我需要对从对象中检索到的值进行一些计算,所以我写

${employee.field1} + ${employee.field2}
// not working but results in string 1 followed by string 2
// say field1=3 , field=4 , output cell has 3+4 not 7
=sum(${employee.field1} ,${employee.field2})
// not working says error
=sum(${employee.field+employee.field2})
// not working says error

如何正确编写公式以在输出 xls 表中获得所需的计算

4

0 回答 0