This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display Tag

 
Bilal A.Siddiqui
Ranch Hand
Posts: 31
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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
  • 0
  • 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
Pie
Posts: 42966
73
  • 0
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic