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!

4

2 回答 2

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>
于 2010-02-01T03:04:59.647 回答
0

您也可以使用:

媒体="html"

为了区分您将在 html 中显示的内容和在 Excel 中显示的内容。此外,您可能有一个名为 ExcelView 的类,并定义要在导出文件中打印的内容。像这样的东西

于 2013-03-18T11:05:09.123 回答