Re: Exporting data in a DefaultDataTable to xls or csv file

2009-08-09 Thread schapey

which had a snippet of code in which the user indicates no longer
outputs the data but a fragment of sql.  

Correction I meant a "fragment of "html".

sorry.
-- 
View this message in context: 
http://www.nabble.com/Exporting-data-in-a-DefaultDataTable-to-xls-or-csv-file-tp24884267p24886873.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Exporting data in a DefaultDataTable to xls or csv file

2009-08-08 Thread Karen Schaper
Hi,

I am trying to export the contents of DefaultDataTable

to an excel spreadsheet.

I found this post...

http://www.nabble.com/export-excel-file-via-an-OutputStream-td16416239.html#a16416239

which had a snippet of code in which the user indicates no longer
outputs the data but a fragment of sql.  There were responses but I'm
not following on how to get the data from the data table into the output
stream for an excel spreadsheet.

Here's the snippet of code that I was looking at.

Button button = new Button("excelExport")
 { 
public void onSubmit() { 
getRequestCycle().setRequestTarget( 
new ComponentRequestTarget(dataTable) 
); 
WebResponse wr = (WebResponse)getResponse();
wr.setContentType( "excel/ms-excel;
name="+getMSExcelFilename() ); 
wr.setHeader( "content-disposition",
"attachment;filename="+getMSExcelFilename() ); 
} 
};

Any help is greatly appreciated!

Thanks

Karen


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org