<style> .header { margin-left: 250px; font-family: Calibri; font-size: 35px; } </style> @(Html.EJ().Grid<object>("Grid") .Datasource((IEnumerable<object>)ViewBag.datasource) .ToolbarSettings(toolbar => { toolbar.ShowToolbar().ToolbarItems(items => { items.AddTool(ToolBarItems.PrintGrid); }); }) .AllowPaging() .Columns(col => { col.Field("OrderID").HeaderText("Order ID").TextAlign(TextAlign.Right).Width(90).Add(); col.Field("CustomerID").HeaderText("Customer ID").Width(90).Add(); col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(80).Add(); col.Field("Freight").HeaderText("Freight").TextAlign(TextAlign.Right).Width(80).Format("{0:C}").Add(); col.Field("ShipName").HeaderText("ShipName").Width(150).Add(); col.Field("ShipCountry").HeaderText("ShipCountry").Width(90).Add(); }).ClientSideEvents(eve=>eve.BeforePrint("beforeprint"))) <script type="text/javascript"> function beforeprint(args) { args.element.append(" <label id='lblFooter' runat='server' class='copyrights'>Copyright © 2001 - 2014 Syncfusion Inc. All Rights Reserved</label>"); args.element.prepend("<label id='lblHeader' runat='server' class='header'>Syncfusion</label>"); } </script> |