how to create report in pdf format
how to create report in pdf format
erum
Posts: 9Questions: 4Answers: 0
Can any one share me how to print report in pdf format when button click ,mvc view just have single button which shows report ?? i do not want to bind data in view,just want in action method .
@model CallCenterCRM.TBL_CustomerMaster
<script>
$(document).ready(function () {
$('#example').DataTable({
dom: 'Bfrtip',
buttons: [
//'copyHtml5',
//'excelHtml5',
//'csvHtml5',
'pdfHtml5'
]
});
});
</script>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-group">
<div class="col-md-10">
@Html.ActionLink("Show All Customer", "ShowReport", "Customer")
</div>
</div>
}
public ActionResult ShowReport()
{
return View();
}
This discussion has been closed.
Answers
DataTables' Buttons extension doesn't have a print pdf option. It has a print view option and a pdf export option. If you want to print a pdf with a single click you'd need to add that ability - I'm not sure how you'd do that since you can't write Javascript for the pdf viewer from the browser...
Allan
Allan ,u r not getting me ,
let me rephrase problem ,suppose i have view where two calendar exist ,one for start and second is for end date .
when user select dates ,it print between two dates on button click.
what is best possible way to do so.
You can create a custom filtering plug-in if you need to filter a table over a range of data. This example shows how it can be done with simple integers, but you could extend that to work with dates if you need.
Then when you use Buttons to export the data, it will (by default) only export the filtered data.
Allan
how can extend
If you need an example of that written, it would be covered by the quick support options.
Allan
i change my code to print report ,but its not creating pdf
@model IEnumerable<CallCenterCRM.Models.ViewModel.EmpDeptDesignationModel>
EmpDeptDesignationModel