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
Nilesh Makwana
1.4k
368
11.7k
Export Excel from Database in Asp.Net MVC using partial view
Aug 23 2018 9:26 AM
hi,
i want to export(Create) and Downlod excel file from database in ASP.NET MVC ,anddownlod button is in partial view(is in popup) but it is not working and not show any error,,iam use ExcelPackage and create two datatable and combine customize cell ,, in worksheet
HttpContext.Response.Clear();
HttpContext.Response.AddHeader("", "");
HttpContext.Response.Charset = System.Text.UTF8Encoding.UTF8.WebName;
HttpContext.Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
HttpContext.Response.AddHeader("content-disposition", "attachment;
filename=filename.xlsx);
HttpContext.Response.ContentType = "application/excel";
HttpContext.Response.ContentEncoding = System.Text.Encoding.GetEncoding("utf-8");
HttpContext.Response.BinaryWrite(excel.GetAsByteArray());
HttpContext.Response.End();
is not working
Reply
Answers (
4
)
Host ASP.NET Website
Inserting an Image to webpage programatically, at runtime.