I know I know, there are many threads on exporting to excel, though I haven't seen any going this route.
I'm going off the solution in the following link, though there are a few things I need that are different then what is shown.
The solution shown relys on a "Template" file to be location on the client machine, and Hard Codes the Save Path and File Name.
This works, and produces the perfect file in the end, but I need the user to be prompted with the standard Save As diag option. As you'd see with other methods where you export in the form of CSV file.
//Make a copy of the template file
File.Copy("template.xlsx", "generated.xlsx", true);
//Open up the copied template workbook
using (SpreadsheetDocument myWorkbook =
This initial code snippit results in the site taking template.xlsx and creating 'Generated.xlxs' saving it at C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0 (not really user friendly)
A) How do I have the template either stored on the website, or Created on the Fly?
B) How do I prompt the user for the File Name and Location where they want to save the file?
View Complete Post