I need to export timetable from the database to Excel file on-the-fly on ASP.NET WebForms site.
When user clicks "Export to Excel" link, he gets this file generated. I don't want to generate it explicitly and store on a server to provide download-on-a-demand, because then it'll be hundreds of files. I have all the data to do it, so the question is only about what approach to use.
One of my colleagues done this before in a very ugly way - he created separate web page, pushed all the data needed for export to a StringBuilder instance, then wrote all its contents to Response object, and added an appropriate headers to make it look like Excel file. All this work is 300 loc done in Page_Load event handler.
And our server hasn't Excel installed - yet another tricky thing.
Any suggestions? Thanks in advance
SpreadsheetGear for .NET makes this easy to do.
You can see a number of live samples on our Excel Reporting Samples page here and download the free trial here.
Disclaimer: I own SpreadsheetGear LLC