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
Ayush Agarwal
NA
58
6.7k
Export Data to Excel using OpenXML in Asp.Net MVC
Oct 23 2019 4:52 AM
How do we create a Excel file using
OpenXML
(not its extended libraries like EPPlus or Closed XML) in Asp.Net MVC and export data to a worsheet in it from a Datatable. The call to Action is done via Ajax.
$("#btnGenerateReport").click(function () {
$.ajax({
type: "POST",
url: '@Url.Action("GenerateReport", "ProcessInputData")',
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (response) {
if (response.success) {
window.location = '@Url.Action("Download", "ProcessInputData")';
}
else {
$("#errorModalMessageId").html(response.responseText);
$('#errorModal').modal('show');
}
},
error: function (ex) {
var r = jQuery.parseJSON(response.responseText);
$("#errorModalMessageId").html("Message: " + r.Message + "\nStackTrace: " + r.StackTrace + "\nExceptionType: " + r.ExceptionType);
$('#errorModal').modal('show');
}
});
Reply
Answers (
2
)
How search and display db data in grid using drop-down check
Web API authentication through Google