打印啊,完全没做过求求各位大神,帮帮忙啊求讲解一点细节都不放过啊,如果有实例更好。
救命啊.....
解决方案 »
- 一个页面有两个.ascx文件,如何在一个.ascx里的gridview里删除数据后,同时更新另一个ascx里的lable里的值?
- web程序自动运行的问题,急啊~~~
- 请教关于多级分布式数据库
- 在线等待,在GridView中如何让一条记录按多行显示
- 我的VS2005新建网站的时候没有解决方案,而人家的都有?
- 放分! 事件最近总莫名其妙的丢失掉,大家遇到过没?
- 水晶报表导出PDF打印字体变小问题。
- 请问超级链接控件能不能有点击事件?
- 帮我看看究竟是哪里出错,怎么改都不行
- 如何将数据存入内存,asp.net每次访问直接到内存去取,而不用读数据库
- 急求~~在线等-100分---直接在地址栏输入aspx页面名,访问不了
- 求一条SQL语句?查询名次
<script language="javascript" type="text/javascript">
var HKEY_Root, HKEY_Path, HKEY_Key;
HKEY_Root = "HKEY_CURRENT_USER";
HKEY_Path = "\\Software\\Microsoft\\Internet Explorer\\PageSetup\\";
//设置网页打印的页眉页脚为空
function PageSetup_Null() {
try {
var Wsh = new ActiveXObject("WScript.Shell");
HKEY_Key = "header";
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
HKEY_Key = "footer";
Wsh.RegWrite(HKEY_Root + HKEY_Path + HKEY_Key, "");
}
catch (e)
{ }
}
function printpage(myDiv){ //DIV控制打印
//var newstr = document.all.item(myDiv).innerHTML;
var newstr = document.getElementById(myDiv).innerHTML;
// alert(newstr);
var oldstr = document.body.innerHTML;
document.body.innerHTML = newstr;
window.print();
document.body.innerHTML = oldstr;
return false;
}
function preview() {
PageSetup_Null();
bdhtml=window.document.body.innerHTML;
sprnstr="<!--startprint-->";
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
window.print();
}
</script> <style>
body
{
font-size: 16px;
color: Black;
}
</style>
<style media="print">
.Noprint
{
display: none;
}
.PageNext
{
page-break-after: always;
}
</style>
<div style="text-align: center; height: 30px; width: 595" class="Noprint">
<input class="Noprn" type="button" onclick="window.print()" value="打印" />
<input type="button" name="print" value="预览并打印" onclick="preview()" />
<input type="button" id="bt" onclick="javascript:printpage('bt')" value="DIV打印" />
<asp:Button ID="Button1" runat="server" Text="编辑" onclick="Button1_Click" />
<asp:Button ID="Button2" runat="server" Text="保存" Visible="false"
onclick="Button2_Click" />
</div>