zimmer9
asked on
How to give an Excel file a file name when exporting a GridView to Excel 2003 when using ASP.NET 4.0 with C# and VS2010 ?
I'm writing my first ASP.NET 4.0 application using C# with VS2010.
I am trying to export a stored procedure result set to Excel 2003.
When I create the new Excel file, I noticed that it is named DEFAULT.XLS.
DEFAULT is the name of the web page.
Do you know how I can modify my code to assign the newly created Excel file the file name Contacts.XLS rather than Default.XLS?
My code is in the attached file:
ASP-CODE.txt
I am trying to export a stored procedure result set to Excel 2003.
When I create the new Excel file, I noticed that it is named DEFAULT.XLS.
DEFAULT is the name of the web page.
Do you know how I can modify my code to assign the newly created Excel file the file name Contacts.XLS rather than Default.XLS?
My code is in the attached file:
ASP-CODE.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent catch!!!
2/ Excel is smart/dumb enough to accept a textfile as input
3/ Default is the name of any new excel workbook i believe. When you press save.