I just downloaded the “Excel” file from the ASP.NET application, saved instead of opening it, renamed it to xxx.txt and opened it in a text editor.  The content was indeed simply the table portion of an HTML file!  So is there a simple way to put the HTML rendering of a Wicket ListView or DataTable into a String?  /Frank

 

-----Original Message-----
 Igor Vaynberg,
Wednesday, February 01, 2006 4:13 PM

 

from reading the above code all you are doing is rendering the grid into the response by itself with the additional header? but it is still in its unchanged html format?

On 2/1/06, Frank Silbermann <[EMAIL PROTECTED]> wrote:

ASP.NET has an easy way to return a DataGrid as a Microsoft Excel file:

Dim stringwriter As New System.IO.StringWriter()
Dim htmlwriter As New System.Web.UI.HtmlTextWriter(stringwriter)

DataGrid1.RenderControl(htmlwriter)
Response.AppendHeader("content-disposition",
"attachment;filename=name.xls")
Response.Write(stringwriter.ToString())
Response.End()

What is nice is that the Excel worksheet reflects the styling of the
DataGrid.  I don't suppose that the DataTable of Wicket Extensions has
anything like this capability.  Is there an easy way to do this?

I've looked at the JExcelAPI and jXLS, but these solutions are much too
low-level for me -- much harder to use than the simple code above.  I
can do without the fancy formatting; I'm willing to settle for code that
simply returns the user a default Excel file whose grid is filled from
an arbitrary two-dimensional array of strings (or list of lists, or
whatever).

What is the simplest solution?

/Frank Silbermann


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmdlnk&kid3432&bid#0486&dat1642
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

 

Reply via email to