打印GridWeb

Contents
[ ]

打印 GridWeb

为了打印内容,Aspose.Cells.GridWeb for .NET已经公开了GridWeb.Print客户端函数,可以在JavaScript调用中使用,如下所示。

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>

一旦JavaScript函数就位,就可以在选择的任何事件上触发它。请检查以下ASP.NET片段,它在按钮单击事件中使用了上述定义的JavaScript函数。

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;" />