GridWeb を印刷する
Contents
[
Hide
]
開発者は、結果を Microsoft Excel スプレッドシート ファイルとして保存せずに、Web ページから GridWeb コンテンツを印刷する必要がある場合があります。 Aspose.Cells.GridWeb コントロールは、クライアント側関数を介してこの機能をサポートします。
GridWeb の印刷
コンテンツを印刷するために、Aspose.Cells.GridWeb for .NET は、以下に示すように JavaScript 呼び出しで使用できる GridWeb.Print クライアント側関数を公開しています。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 スニペットを確認してください。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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;" /> |