• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Issue with DisplayTag export

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to use the DisplayTag export to excel / csv feature. I am using Spring and Tiles. According to the DisplayTag documentation, I have followed the process recommended and implemented the filter to support tiles. I can view the data. However, the "Export to Excel" button does not work.

In my JSP, I have a search button and based on the input, a list is returned to the same JSP and rendered in a table. When I click on the "Export" button, it returns to the same page but now the table data is no longer visible and the export feature also doesnt work. On the logs, I dont see any exception but I see this message -

ExportDelegate, DEBUG, org.displaytag.filter.ExportDelegate: Filter is enabled but exported content has not been found. Maybe an error occurred?

My web.xml has the following-

<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>

<taglib-uri>http://displaytag.sourceforge.net/</taglib-uri>;
<taglib-location>/WEB-INF/displaytag-12.tld</taglib-location>
</taglib>


JSP has the following pertaining to displaytag -

<display:table name="command.searchList" id="row" requestURI="/search.do" export="true">
<display:column property="dept" title="Department" media="html csv excel xml"/>
<display:column property="emp" title="Employess" media="html csv excel xml"/>
<display:column property="salary" title="Salary" format="$ {0,number,0,000.00}" media="html csv excel xml"/>
<display:setProperty name="css.tr.even" value="cuesTableRowEven" />
<display:setProperty name="css.tr.odd" value="cuesTableRowOdd" />
</display:table>


- where search.do is the action invoked to render this jsp

In displaytag.properties -

export.types=excel
export.excel=true
export.excel.class=org.displaytag.export.excel.DefaultHssfExportView
export.excel.include_header=true


Problem is that I dont see any exceptions, its just that the export feature just doesnt work. I'd really appreciate if anyone can help out.

Thanks.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

I have the same issue as you have mentioned.Please be kind enough to display the solution if you found a one.

Thanks
Dhanushka
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everyone

i (STILL) have the same error, it migth be the tiles configurations or the beans names.. but i'm not sure and i havenĀ“t solve the problem...

does anyone of you solved this problem?

please if you have solved the problem help me =D


=( .........
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jesus Rafael Lopez Ibarra and welcome to Javaranch! I'm not a user of these tags, but you might want to do a search for posts in this forum, there are many questions on these tags.
 
Jesus Rafael Lopez Ibarra
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martijn Verburg and thanks, yes, i'll look for it, i have this problem just into a jsp but no in the first one i did, but i dunno why.

well thanks! i'll find it out!
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an old topic, but I'll post a solution since someone may have the same problem nowadays, like I did.

I had the same problem a couple of days ago while modifying an old struts 1 application written by some else and it wasn't that easy to find the solution since I'm "new" to struts/jsp. The problem was that the display grid was "buried" under 2 levels of tiles and the filter seemed unable to get rid of the extra html.

My solution was to make a new "view" (forward in struts lingo) for the export, with only the grid and nothing else, and in the action I select this forward when exporting (I used the presence of one of the parameters that displaytag adds to the querystring, "d-49653-e" in my case).
 
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic