2

I'm using the DisplayTag library (http://displaytag.sourceforge.net/) for tables in my JSP and I'm taking advantage of the export functionality that comes with it.

I want to export the table contents to an Excel file but I want to modify what is written out to the Excel file to include extra information and to change the format of the data.

Is it possible to specify a decorator to get this done?

Thanks!

JMM
  • 3,922
  • 6
  • 39
  • 46

2 Answers2

4

This is discussed in the documentation here. To use their example:

<display:table name="test" export="true">
    <display:setProperty name="decorator.media.html"  value="org.displaytag.sample.decorators.HtmlTotalWrapper" />
    <display:setProperty name="decorator.media.excel" value="org.displaytag.sample.decorators.HssfTotalWrapper" />
</display:table>
skaffman
  • 398,947
  • 96
  • 818
  • 769
0

Also you can use:

media="html"

In order to separate what you will display in html and what in Excel. Moreover you might have a class named ExcelView and define what you want to print in the exported file. Something like this

Lefteris Bab
  • 787
  • 9
  • 19