WebObjects/Project WONDER/Frameworks/ExcelGeneration

From Wikibooks, open books for an open world
< WebObjects‎ | Project WONDER
Jump to navigation Jump to search

ExcelGeneration[edit | edit source]

Anjo Krank[edit | edit source]

You need to override appendToResponse on your page and make it look similar to:

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