export datagrid results to a file (VS2005/SQL2005)

I have managed to get a drop-down to load a datagrid based on selection and need some way to get the data out of the webpage to a file, be it Excel of CSV, etc. I know in the "old" ASP world you can set the output of a table to the MIME type and have the results auto-load. (hope that makes sense...)

Is there a similar feature with .NET? I am in a morass of config conflicts trying to get what i have to attempt to load to Report Server (which I prefer as Access-style grouping may be called for) but at the moment a simple, clean, export ThisTable to a file will be a big win. BTW, I have had significant problems getting .NET to work so that other people can at least load a page from my dev server. Any suggestions on what to do there will also be hugely appreciated!

Re: export datagrid results to a file (VS2005/SQL2005)

Did I understand correctly that you have an instance of SQL Reporting Services available? If so, why don't you use a report to export your data to Excel, PDF, etc.? You can build the report to read its data from the same source that you're using to present it via the webpage you mentioned.

I don't mean to send you to resources outside of Woody's Lounge, but you'll probably need to start (or continue) looking at other forums that are more development-centric than Woody's.

Re: export datagrid results to a file (VS2005/SQL2005)

I do have Report Server installed but can't get it to work at the moment. What I wanted was a simple method to write the contents of a displayed datagrid to a CSV file. I have managed to get something sort-of working using application/vnd-excel on a referring page (using Server.Transfer) and it works with several limitations - I think I'll need to implement a full fso output to file to output a tab-deliminated (or comma, whatever) to a file to avoid Excel row limitations. If there's a significant amount of data in the grid the export to Excel fails. Also, the data is exported twice, so there's some issues to iron out. I'm trying to avoid complicating the project with Report Server configs...but it's good enough for "demo" so I'm on track for that...