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
Falak Kathuria, RCA
NA
18
435
Download Excel reports based on tables in MVC
Nov 7 2019 11:51 AM
I am writing a code to pass a different data table into the view depending on a dropdown value. I have created 4 Partial Views and called them into the main controller using the if statement which uses the dropdown value to determine the code. The code seems not be working at the moment. The function is invoked on a button click and the ultimate goal is to copy the values of the datatable onto an Excel sheet. The function to invoke different partials views is given below:
function fnExcelReport() {
if (SelectedValue == 1) {
<div>
@{Html.RenderAction("Report1");}
</div>
}
else if (SelectedValue == 2) {
<div>
@{Html.RenderAction("Report2");}
</div>
}
else if (SelectedValue == 3) {
<div>
@{Html.RenderAction("Report3");}
</div>
}
else if (SelectedValue == 4) {
<div>
@{Html.RenderAction("Report4");}
</div>
}
}
Reply
Answers (
1
)
Note Pad Open Close save button and Editable
reference to a name space