office 无法打开xlsx文件的问题

1. 设置content-type和header

    response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    response.addHeader("Content-Disposition", "attachment;filename=fileName" + ".xlsx");

2.使用XSSFWorkbook创建Workbook

   Workbook workbook = new XSSFWorkbook();

 

原文链接:https://blog.csdn.net/a602049511/article/details/52367563

你可能感兴趣的:(office 无法打开xlsx文件的问题)