We let users create ad-hoc queries in our website. We would like to have the user select their criteria, then click submit and have the results streamed automatically to Ex
If you create a page that is just a table with the results and set the page's content type to "application/vnd.ms-excel", then the output will be in Excel.
Response.ContentType = "application/vnd.ms-excel";
If you want to force a save, you would do something like the following:
Response.AddHeader("Content-Disposition", "attachment; filename=somefilename.xls");