aspose file tools*
The moose likes Other Open Source Projects and the fly likes DisplayTag: Export to csv with headers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "DisplayTag: Export to csv with headers" Watch "DisplayTag: Export to csv with headers" New topic
Author

DisplayTag: Export to csv with headers

karan chandok
Greenhorn

Joined: Jul 15, 2011
Posts: 25
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
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
How are you exporting the data? What particular problem are you facing in adding an extra first line to the CSV file?


Ping & DNS - my free Android networking tools app
karan chandok
Greenhorn

Joined: Jul 15, 2011
Posts: 25
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
Marshal

Joined: Mar 22, 2005
Posts: 42286
    
  64
There's a property setting for that; see http://www.displaytag.org/1.2/configuration.html for details.
karan chandok
Greenhorn

Joined: Jul 15, 2011
Posts: 25
Thanks a lot Ulf Dittmer

It solves my problem.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: DisplayTag: Export to csv with headers