跳转到内容

WebObjects/Project WONDER/Frameworks/ExcelGeneration

来自维基教科书,开放的书籍,开放的世界

ExcelGeneration

[编辑 | 编辑源代码]

Anjo Krank

[编辑 | 编辑源代码]

您需要覆盖页面上的appendToResponse,并使其类似于

 public void appendToResponse(WOResponse response, WOContext context) {
   super.appendToResponse(response, context);
   if(reportData != null) {
     response.setContent(reportData);
     reportData = null;
     String fileName = "results.xls";
     response.setHeader("inline; filename=\"" + fileName + "\"", "content-disposition");
     response.setHeader("application/vnd.ms-excel", "content-type");
     enableExcel = false;
   }
 }
华夏公益教科书