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
Yogesh Vedpathak
669
1.4k
197.7k
Export All Data (Paging in a Gridview ) To Excel sheet
Apr 4 2018 4:20 AM
Hello I want to Export All Data (Paging in a Gridview ) To Excel sheet
Current Status: Export Data Working But getting only 1 Page data when i am into that page
I want to export data ( Data in all pages ) into excel sheet ..
Code here ...
protected
void
ExportToExcel_click(
object
sender, EventArgs e)
{
ExportGridToExcel();
}
protected
void
ExportGridToExcel()
{
Response.Clear();
Response.Buffer =
true
;
Response.ClearContent();
Response.ClearHeaders();
Response.Charset =
""
;
string
FileName =
"Yogesh"
+ DateTime.Now +
".xls"
;
StringWriter strwritter =
new
StringWriter();
HtmlTextWriter htmltextwrtter =
new
HtmlTextWriter(strwritter);
GridView1.AllowPaging =
false
;
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType =
"application/vnd.ms-excel"
;
Response.AddHeader(
"Content-Disposition"
,
"attachment;filename="
+ FileName);
GridView1.GridLines = GridLines.Both;
GridView1.HeaderStyle.Font.Bold =
true
;
GridView1.RenderControl(htmltextwrtter);
// GridView1.AllowPaging = false;
Response.Write(strwritter.ToString());
Response.Flush();
Response.End();
}
Reply
Answers (
2
)
how to send otp to email
how to connect database file in my asp.net project