Note that there are some explanatory texts on larger screens.

plurals
  1. POproblem with using displaytag + tiles to export excel
    text
    copied!<p>DisplayTag 1.2 Spring + MVC 2.5.6 Tiles 2.0.7</p> <p>I have taken a look at some other items on this site around the same subject area but none seem to answer the question of how to export a table generated by display tag into excel. I am able to export/save xml and csv but not excel. Other jars that are needed?</p> <p>Basic set up:</p> <p>web.xml</p> <pre><code> &lt;!-- display tag --&gt; &lt;filter&gt; &lt;filter-name&gt;ResponseOverrideFilter&lt;/filter-name&gt; &lt;filter-class&gt;org.displaytag.filter.ResponseOverrideFilter&lt;/filter-class&gt; &lt;/filter&gt; &lt;filter-mapping&gt; &lt;filter-name&gt;ResponseOverrideFilter&lt;/filter-name&gt; &lt;url-pattern&gt;*.jsp&lt;/url-pattern&gt; &lt;/filter-mapping&gt; </code></pre> <p>displaytag.properties</p> <pre><code>#export export.types=csv excel xml rtf pdf export.excel=true export.xml=true export.csv=true export.rtf=false export.pdf=false export.excel.class=org.displaytag.export.excel.DefaultHssfExportView export.pdf.class=org.displaytag.export.DefaultPdfExportView export.rtf.class=org.displaytag.export.DefaultRtfExportView export.excel.include_header=true export.cvs.include_header=true </code></pre> <p>html</p> <pre><code>&lt;display:table export="true" id="row" class="gridTable" name="shippingCommands" defaultsort="1" sort="list" requestURI="shipHome.html" defaultorder="ascending" pagesize="100"&gt; &lt;display:column title="Customer Name" sortable="true" sortName="customerName"&gt; ${row.customerName } &lt;c:if test="${null != row.customerContactName}"&gt; &lt;br /&gt; &lt;br /&gt;${row.customerContactName} &lt;/c:if&gt; &lt;/display:column&gt; &lt;display:column property="storeNumber" title="Store #" sortable="true" sortName="storeNumber" comparator="vsg.ecotrak.common.comparator.AlphanumComparator"/&gt; &lt;display:column property="storeAddress" title="Store Address"/&gt; &lt;display:column property="programName" title="Program" sortable="true" sortName="programName"/&gt; &lt;display:column property="boxType" title="Box Type" sortable="true" sortName="boxType"/&gt; &lt;display:column class="table-10" property="qtyToShip" title="# of Boxes" sortable="true" sortName="qtyToShip"/&gt; &lt;display:column property="orderType" title="Order Type" sortable="true" sortName="orderType"/&gt; &lt;display:column class="actions" media="html"&gt; &lt;a class="action-fulfill" href="shipSummary.html?action=summary&amp;orderId=${row.orderId}"&gt;Fulfill&lt;/a&gt; &lt;a class="action-delete" href="javascript:confirmDelete(${row.orderId})" title="Delete Order" &gt;Delete Order&lt;/a&gt; &lt;/display:column&gt; &lt;display:setProperty name="export.rtf.filename" value="boxestoship.rtf"/&gt; &lt;display:setProperty name="export.csv.filename" value="boxestoship.csv"/&gt; &lt;display:setProperty name="export.excel.filename" value="boxestoship.xls"/&gt; &lt;display:setProperty name="export.xml.filename" value="boxestoship.xml"/&gt; &lt;/display:table&gt; </code></pre> <hr> <p>It turns out that excel works with poi-3.2-FINAL.jar and not poi-3.7. Not sure why but that is what I did to get it to work.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload