Child pages
  • Project WONDER-Frameworks-ExcelGeneration
Skip to end of metadata
Go to start of metadata

ExcelGeneration

Anjo Krank

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) {
     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;
   }
 }


Additionally from Anjo:

The idea behind ExcelGenerator ist that you can use - hopefully - the same HTML that you output anyway for your reporting tasks. In particular, you should be able to re-use DynaReporter HTML and you also need only a minimal amount of work to use D2W.

Sometimes, you might need to apply some xslt, but otherwise you don't need additional code and there is no "api" to learn.

It's just a wrapper to your tabular HTML and it kind of makes me wonder why there isn't already tool like it in the POI stuff.

  • No labels