h1. Excel module

The Excel module allows you to render Excel document. It is rather simple to use as it only requires to import a static file.


This module helps web developer to generate Excel report. The tool uses the jxls library. 

In order to use the Excel module, you need to create an Excel based template - see http://jxls.sourceforge.net for details instruction.

h2. <a>Enable the Excel module for the application</a>

In the **/conf/application.conf** file, enable the Excel module by adding this line:

bc. # The Excel module
module.Excel=${play.path}/modules/Excel
excel.template.root=app/views

note, please change the excel.template.root from app/views to some where else when you use excel module with Play version 1.02 or before. Otherwise your application will not be able to startup on product mode.

h2. <a>Using the Excel module</a>

h3. <a>The renderExcel() method</a>:

bc. import static play.modules.excel.Excel.*;

And then use the renderExcel() method as you would use the render() method.

The renderExcel() behavior is almost the same as that of render() except the following differences:
# the template should be an excel file with ".xls" suffix rather than a text file with ".html"
# You can use renderArgs.put("fileName", "your-file.xls") to indicate the name of the excel file to be generated

h2. Known Issue

* While using chrome and IE, the filename is not the one specified by "fileName" but the last string in the url. E.g. if the url is http://localhost:9000/1/namecard, the file name will be namecard instead of 1.xls which is specified in the program. There is not such problem in FF.

Please refer to the sample for an example.
