Print GridWeb

Printing GridWeb

In order to print the contents, the Aspose.Cells.GridWeb for .NET has exposed the GridWeb.Print client-side function which can be used in a JavaScript call as demonstrated below.

For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
<script>
function Print(grid) {
// Get Id of GridWeb
var grid = document.getElementById('<%= GridWeb1.ClientID %>');
// Call print
grid.print();
}
</script>

Once the JavaScript function is in place, it can be triggered on any event of choice. Please check the following ASP.NET snippet which uses the above defined JavaScript function on a button click event.

For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
<asp:Button ID="btnPrint" runat="server" Text="Print" OnClientClick="Print();return false;" />