Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display Tag

 
Bilal A.Siddiqui
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My requirement is to export the report in excel. I am using display tag with struts for this. Everything is running, the report is getting displayed with proper columns and paging and export option is also working good. Now what i want is to use only export option i do not want to display data i just want an export option, i am unable to do this.

My code looks like this




Sorry if i am posting my query in wrong forum, as i using it with struts so i am posting it here





Regards & Thanks
Bilal
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to http://displaytag.sourceforge.net/1.2/tut_style.html, any style and class attributes assigned to the <display:table> tag will be reflected in the generated HTML. That -in conjunction with the "thead" tag and the "odd" and "even" classes for the rows- should allow you to render the table invisible via CSS.

Not sure of a way to not actually render the table in the page.
 
Bilal A.Siddiqui
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Ulf. Can you please suggest me any other way to export the data from resultset to excel. i am using struts.

Regards & Thanks
Bilal
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a library like Apache POI or jExcelApi to create XLS/XLXS files, and stream those files to the client.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic