2009-04-15 16:00:47 UTC
And the way to use it in my jsp, don't forget to include the javascript based on the browser type as discussed in my previous post:
<div id="tbl-container"><display:table
name="sessionScope.participantList" export="true" id="tmpId"
class="dataTable" defaultorder="ascending" cellspacing="1" >
<display:setProperty name="decorator.media.html"
value="displaytag.sample.decorators.MyHtmlTotalWrapper" />
<display:setProperty name="export.pdf.decorator"
value="displaytag.sample.decorators.MyITextTotalWrapper" />
<display:setProperty name="export.pdf.filename" value="ParticipantProfile.pdf" />
<display:setProperty name="export.rtf.decorator"
value="displaytag.sample.decorators.MyITextTotalWrapper" />
<display:setProperty name="export.rtf.filename" value="ParticipantProfile.rtf" />
<display:setProperty name="export.excel.filename" value="ParticipantProfile.xls" />
<display:setProperty name="export.csv" value="true" />
<display:setProperty name="export.csv.filename" value="ParticipantProfile.csv" />
<display:setProperty name="export.xml" value="true" />
<display:setProperty name="export.xml.filename" value="ParticipantProfile.xml" />
<display:setProperty name="paging.banner.placement">top</display:setProperty>
<display:column title="" >
</display:column>
</display:table></div>
<tr><td> </td></tr>
<div id="export-links">
</div>
I have used some custom wrapper classes to modify the content, and to customize my export and filter it. Let me know if someone is interested in it, for example, it now exports the result as WYSYWIG meaning even specific fields will have the generic grouping and summing rather than to write grouping and summing on a specific column as is done in the example:
http://displaytag.homeip.net/displaytag-examples-1.2/example-new-export.jsp
This logic works on specific column only, where as I wrote code that is generic.