Stampa GrigliaWeb
Contents
[
Hide
]
Ci sono momenti in cui gli sviluppatori devono stampare i contenuti di GridWeb da una pagina web senza salvare il risultato come file di foglio di calcolo Excel Microsoft. Il controllo Aspose.Cells.GridWeb supporta questa funzionalità tramite la funzione lato client.
Stampa GridWeb
Per stampare i contenuti, Aspose.Cells.GridWeb for .NET ha esposto la funzione lato client GridWeb.Print che può essere utilizzata in una chiamata JavaScript come illustrato di seguito.
This file contains 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> |
Una volta che la funzione JavaScript è a posto, può essere attivata su qualsiasi evento di scelta. Controlla il seguente frammento ASP.NET che utilizza la funzione JavaScript sopra definita su un evento di clic del pulsante.
This file contains 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;" /> |