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 関数が配置されると、任意のイベントでトリガーできます。ボタン クリック イベントで上記で定義された JavaScript 関数を使用する次の ASP.NET スニペットを確認してください。

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