• 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
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

DisplayTag: Export to csv with headers

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

I am able to export my jsp page table data into csv file.
But the problem is I want to export headers also in first row.Please suggest how to do that.

Thanks in advance
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you exporting the data? What particular problem are you facing in adding an extra first line to the CSV file?
 
karan chandok
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using display tag like this.
<display:table style="margin:10px;margin-top:15px " id="alternatecolor" class="altrowstable" name="summaryList2" pagesize="8" export="true" requestURI="${actionName}" >
<display:column property="operator" title="Operator" sortable="true"/>
<display:setProperty name="export.csv" value="true" />


But problem is it is not exporting column names.Please suggest how can I do that.
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's a property setting for that; see http://www.displaytag.org/1.2/configuration.html for details.
 
karan chandok
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Ulf Dittmer

It solves my problem.
 
I'm a lumberjack and I'm okay, I sleep all night and work all day. Lumberjack ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!