Index value is showing numbers but when i click on print it shows [object][object] on index column in data table
@model DHIFeedbacl.Models.FeedBack
@{
ViewBag.Title = "Department Of Heavy Industry and Public Enterprises";
}
<table style="margin-top:25px" id="tbldrpdown">
<tr>
<td>
List Of DHI Feedbacks For Year
</td>
<td>
@Html.DropDownListFor(model => model.Selectedyear, (IEnumerable<SelectListItem>)ViewBag.years, "--Select Year--", new { @class = "form-control", onchange = "UserChanged()" })
</td>
<td> and Month </td>
<td>
@Html.DropDownListFor(model => model.SelectedMonth, (IEnumerable<SelectListItem>)ViewBag.month, "--Select Month--", new { @class = "form-control", onchange = "UserChanged()" })
</td>
</tr>
</table>
<label style="color:red">*Kindly Select Margin as Default While Taking Print Out and Remove Check From Header And Footer*</label>
<div class="container" style="margin-top:20px">
<table id="FeedbackDetails" class="ui celled table">
<thead>
<tr>
<th>S.No</th>
<th>User Name</th>
<th>Email ID</th>
<th>Comment</th>
<th>Designation</th>
<th>Organization</th>
<th>Contact No</th>
<th>City</th>
<th>Feedback Date</th>
</tr>
</thead>
</table>
</div>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.css" />
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.19/css/dataTables.semanticui.min.css" />
<link hhref="https://cdn.datatables.net/buttons/1.5.6/css/buttons.dataTables.min.css" rel="stylesheet" />
@section Scripts{
<script src="https://code.jquery.com/jquery-3.3.1.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/1.10.19/js/dataTables.semanticui.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/semantic-ui/2.3.1/semantic.min.js"></script>
<script src="~/Scripts/moment.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.19/dataRender/datetime.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.5.6/js/buttons.print.min.js"></script>
<script src="https://cdn.datatables.net/tabletools/2.2.4/js/dataTables.tableTools.min.js" ></script>"
<script type="text/javascript">
$(function () {
$(document).on("click", ".opencomment", function () {
var mycomment = $(this).data('id');
$(".modal-body #commentdesc").html(mycomment);
});
ApplyDataTable("");
});
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
"date-uk-pre": function (a) {
var ukDatea = a.split('/');
return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
},
"date-uk-asc": function (a, b) {
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
},
"date-uk-desc": function (a, b) {
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
}
});
function ApplyDataTable(year, month,monthname) {
$.ajax({
url: '/ViewFeedback/LoadData',
type: 'GET',
dataType: 'json',
data: { year: year, month: month },
success: function (data) {
var table= $('#FeedbackDetails').DataTable({
"bDestroy": true,
dom:'Bfrtip',
buttons: [
{
extend: 'print',
messageTop: '<u> Feedbacks Received Through DHI Website For The Month Of ' + monthname + ' Of Year ' + year + '<br /><br /><br />',
messageBottom:'<center><p style="margin-top:10px">Created and Designed by NIC-DHI'
},
],
"columnDefs": [{
"searchable": false,
"orderable": false,
"targets": 0
}],
"order": [[1, 'asc']],
"aaData": data.data,
"lengthMenu": [[5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"]],
"autoWidth": true,
"responsive": true,
"lengthChange": true,
"ordering": true,
"columns": [
{ "data": null, "autoWidth": true,},
{ "data": "FeedbackUserName", "name": "User Name", "autoWidth": true },
{ "data": "FeedBackUserEmailID", "name": "Email ID", "autoWidth": true },
{ "data": "FeedBackComment", "name": "Comment", "autoWidth": true },
{ "data": "Designation", "name": "Designation", "autoWidth": true },
{ "data": "Organization", "name": "Organization", "autoWidth": true },
{ "data": "ContactNo", "name": "Contact No", "autoWidth": true },
{ "data": "City", "name": "City", "autoWidth": true },
{ "data": "Feedback_date", "sType": "date-uk", "autoWidth": true },
],
"language": {
"emptyTable": "No Events Found Related To This Month or Year"
},
});
table.on('order.dt search.dt', function () {
table.column(0, { search: 'applied', order: 'applied' }).nodes().each(function (cell, i) {
cell.innerHTML = i + 1;
table.cell(cell).invalidate('dom');
});
}).draw();
}
});
}
//Apply custom search on jquery DataTable
function UserChanged() {
//apply search for Year base report
var year = $('#Selectedyear option:selected').val();
var month = $('#SelectedMonth option:selected').val();
var monthname = $('#SelectedMonth option:selected').text();
ApplyDataTable(year, month,monthname);
}
function UserChanged1() {
var month = $('#SelectedMonth option:selected').val();
ApplyDataTable(month);
}
</script>}