struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Rodriguez Lopez <alo...@flordeutopia.pt>
Subject Re: export to excel - displaytag
Date Tue, 26 Oct 2010 08:54:54 GMT
Hi,

I had the same problem, but it was time ago.

I asume from your code that you followed this:

http://displaytag.sourceforge.net/1.2/export_filter.html

and using Struts 1.

If using this with Struts2 you should have to change the url-pattern to 
*.action or whatever extension you are using.

Also check that you have displaytag-export-poi-1.1.jar in your 
dependencies / classpath like detailed in 
http://displaytag.sourceforge.net/11/install.html

I hope this helps I remember having hell of a days with this one...

Struts User, 25-10-2010 21:41:
> Hi all,
>
> I am trying to export data to excel using diplaytag. I am able to save the
> excel file but the file is empty. Any help is greatly appreciated.
> I am setting the export filter and display-tag properties as below.
>
> *web.xml:*
>
> <filter>
>          <filter-name>ResponseOverrideFilter</filter-name>
>
> <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
>      </filter>
>
>      <filter-mapping>
>          <filter-name>ResponseOverrideFilter</filter-name>
>          <url-pattern>*.do</url-pattern>
>      </filter-mapping>
>      <filter-mapping>
>          <filter-name>ResponseOverrideFilter</filter-name>
>          <url-pattern>*.jsp</url-pattern>
>      </filter-mapping>
>
> *displaytag.properties*
>
> #sort.behavior=list
> #sort.amount=list
> basic.empty.showtable=true
> basic.msg.empty_list=<b>Query returned no results.</b>
> basic.msg.empty_list_row=<tr class="empty"><td colspan="{0}"><img
> alt="Warning" src="images/iconWarning.gif"/>&nbsp;<b>Query returned no
> results.</b></td></tr>
> #paging.banner.placement=top
> #paging.banner.onepage=<span class="pagelinks"></span>
> export.types=csv excel xml pdf rtf
> export.excel=true
> export.csv=true
> export.xml=true
> export.pdf=true
> export.rtf=true
> export.excel.class=org.displaytag.export.excel.DefaultHssfExportView
> export.pdf.class=org.displaytag.export.DefaultPdfExportView
> export.rtf.class=org.displaytag.export.DefaultRtfExportView
> # if set, file is downloaded instead of opened in the browser window
> export.excel.filename=logging_report.xls
> export.excel.include_header=true
>
> *Table.jsp*
>
> <display:table name="lstLoggings" class="tablesorter"  id="loggings"
> length="10" export="true">
>              <display:setProperty name="basic.empty.showtable"
> value="false"/>
>              <display:setProperty name="basic.msg.empty_list" value=""/>
>               <display:setProperty name="export.excel"
> value="true"></display:setProperty>
>              <display:setProperty name="export.excel.filename"
> value="LoggingReport.xls"></display:setProperty>
>
>              <display:column property="noLogins" title="No. of
> Logins"></display:column>
>              <display:column property="sysurAutoKey" title="User
> Key"></display:column>
>              <display:column property="userName" title="User
> Name"></display:column>
>              <display:column property="emailAddress" title="Email
> Address"></display:column>
>              <display:column property="companyName" title="Company
> Name"></display:column>
>              <display:column property="companyCode" title="Company
> Code"></display:column>
>
>          </display:table>
>
> Thanks.
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message