TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Asp.Net Hein
NA
266
166.3k
Want to save as Excel 2013 format (xlsx)
May 19 2015 4:48 AM
Hello, I want to save the gridview to excel file. If I change the place of (.xlsx) to (.xls) , it is saved as 97-2003 excel format.
But now I change the (.xlsx).
It is saved as excel file.But I cannot reopen the excel file.
Can anybody help me in my problem?
Thanks a lot :-)
grvid.AllowPaging = false;
getgrid();
Response.Clear();
Response.AddHeader("content-disposition", "attachment;filename=file-name.xlsx");
Response.ContentType = "application/vnd.xlsx";
System.IO.StringWriter stringWrite = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
grvid.RenderControl(htmlWrite);
Response.Write(stringWrite.ToString());
Response.End();
grvid.AllowPaging = true;
getgrid();
Reply
Answers (
5
)
How to build asp.net web application in command prompt(cmd)?
Assign Textbox value from Generic handler file