|
file:///C:\Users\Administrator\Documents\Tencent Files\969094875\Image\Group\Image2\O{C77N6FW6P1WBWK_5~O20M.jpgfile:///C:\Users\Administrator\Documents\Tencent Files\969094875\Image\Group\Image2\O{C77N6FW6P1WBWK_5~O20M.jpgfile:///C:\Users\Administrator\Documents\Tencent Files\969094875\Image\Group\Image2\O{C77N6FW6P1WBWK_5~O20M.jpg```
public void exportWord(HttpServletResponse response) throws Exception{
Map<String, Object> map = new HashMap<String,Object>();
map.put("buildName", "测试大厦");
map.put("楼层", "303");
map.put("租赁面积", "400");
map.put("房间号", "1001");
List<TestClass> list = new ArrayList<TestClass>();
TestClass test1 = new TestClass();
test1.setNumber(1l);
test1.setHehe("第一个");
TestClass test2 = new TestClass();
test2.setNumber(2l);
test2.setHehe("第二个");
TestClass test3 = new TestClass();
test3.setNumber(3l);
test3.setHehe("第三个");
list.add(test1);
list.add(test2);
list.add(test3);
map.put("pList", list);
XWPFDocument document = WordExportUtil.exportWord07("template/bu.docx", map);
File file = new File("d:\\testExport");
if (!file.exists()) {
file.mkdirs();
}
FileOutputStream fos = new FileOutputStream("d:\\testExport\\export.docx");
document.write(fos);
fos.close();
}
```
代码是这样的 表格导出失败 是怎么回事 求解
|
-
左边结果 右边模板
|