Seam excel export
waltc Mar 24, 2011 1:53 PMI am running a relatively simple seam richfaces application.
I created a new tab and I include a form with a rich:datatable followed by an h:commandLink to export the table contents as an Excel spreadsheet.
When I depress the 'Export to Excel link from all appearances it does something as the completion bar of Firefox moves, stops, then completes the move before the page is rerendered. However I am never presented with the popup window on what to do with the downloaded attachment.
I have ensured the seam-excel and seam-jxl jars are in the web-inf/lib. I have updated the web.xml to add Document Store Servlet and the mapping to it for xls files.
Below is the tab. BTW, this is a war generating seam app running under jboss 5.1.0.GA. There are no errors.
Any suggestions would be greatly appreciated.
thanks,
Walt
<rich:tab name="active">
<f:facet name="label">
<h:panelGroup>Active (#{DailyActivity.resultList.size()} days)</h:panelGroup>
</f:facet>
<h:form id="excelExport">
<rich:panel id="activeCount">
<rich:dataTable value="#{DailyActivity.resultList}" var="_day"
rendered="#{!empty DailyActivity.resultList}" id="excelTable"
style="xls-font: 10 Verdana; xls-column-widths: 8000 8000"
columnClasses="left, right" width="500px">
<rich:column>
<f:facet name="header">
<h:outputText value="Date" />
</f:facet>
<h:outputText value="#{_day.date}" />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="Active" />
</f:facet>
<h:outputText value="#{_day.active}" />
</rich:column>
</rich:dataTable>
<h:commandLink value="Export to Excel Spreadsheet"
rendered="#{!empty DailyActivity.resultList}"
action="#{org.jboss.seam.excel.exporter.excelExporter.export('excelExport:excelTable')}"/>
</rich:panel>
</h:form>
</rich:tab>