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
FIROZ ANSARI
NA
52
5.6k
Export GridView Data into PDF file
Nov 14 2016 1:19 AM
I want to Export grid view data into pdf but only Header & Footer Description is coming.
my Code is below:->
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "attachment;filename=GridViewExport.pdf");
Response.Cache.SetCacheability(HttpCacheability.NoCache);
StringWriter swr = new StringWriter();
HtmlTextWriter htmlwr = new HtmlTextWriter(swr);
grdReports.AllowPaging = false;
BindgrvReports();
grdReports.RenderControl(htmlwr);
StringReader srr = new StringReader(swr.ToString());
Document pdfdoc = new Document(PageSize.A2, 10f, 10f, 10f, 0f);
HTMLWorker htmlparser = new HTMLWorker(pdfdoc);
PdfWriter.GetInstance(pdfdoc, Response.OutputStream);
pdfdoc.Open();
htmlparser.Parse(srr);
pdfdoc.Close();
Response.Write(pdfdoc);
Response.End();
Reply
Answers (
4
)
why not using new when creating an instance ?
How append list value in HiddenFor in Mvc