GridWebを印刷する

GridWeb の印刷

Aspose.Cells.GridWeb for .NET では、以下に示すように、JavaScript の呼び出しで使用される GridWeb.Print クライアント側機能が公開されています。

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