如何在C#中打印gridview页面? [英] How to print gridview page in C#?
本文介绍了如何在C#中打印gridview页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试使用Javascript但仍然无法打印它
我尝试过:
I tried using Javascript but still i can not print it
What I have tried:
<pre>function lnkPrint() {
var printContent = document.getElementById('<%=GridView1.ClientID %>');
var printWindow = window.open("All Records",
"Print Panel", 'left=50000,top=50000,width=0,height=0');
printWindow.document.write(printContent.innerHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
}
推荐答案
您无法在C#中打印页面 - 仅在服务器上运行,并且无法访问完全适用于您的客户端打印机。
You can't print the page in C# - that runs only on the Server, and has no access at all to your client printer.
这篇关于如何在C#中打印gridview页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文