In the firest step need to add razorpdf library the details as given below.
- Go to Visual studio tool
- Go to library package manager
- Go to manage nuget packages
- Go to search razorpdf dll online and install.
In the 2nd step, code sample for cshtml
@model IEnumerable<Model.proc_GetProductServicePDF_Result>
<table border="1" width='500' bordercolor="Green">
@foreach (var item in Model)
{
<tr>
<td>
@Html.DisplayFor(modelItem
=> item.LineOfBusiness)
</td>
<td>
@Html.DisplayFor(modelItem =>
item.ProductClassification)
</td>
<td>
@Html.DisplayFor(modelItem
=> item.Product)
</td>
</tr>
}
</table>
In the 3rd step, code sample for controller
public ActionResult PDF()
{
List<Model.proc_GetProductServicePDF_Result> objPDF = new ProductServiceRepository().GetProductServicePDFDetail(_userSession.CompanyID,
_userSession.TenantID);
}