打印面板内容时出现问题 [英] Problem while printing the contents of a panel

查看:97
本文介绍了打印面板内容时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!!!

我有一个面板,我要使用javascript函数来打印其内容.

该功能是

Hello!!!

I have a panel whose contents i am printing by using a javascript function.

The function is

function printform()
        {
             var printContent = document.getElementById('<%= pnl1.ClientID %>');
             var windowUrl = 'about:blank';
             var uniqueName = new Date();
             var windowName = 'Print' + uniqueName.getTime();
             var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');

             printWindow.document.write(printContent.innerHTML);
             printWindow.document.close();
             printWindow.focus();
             printWindow.print();
             printWindow.close();
        }



它工作正常,但是当我打印时,在页面标题中,第1页的第1页得到打印,在页面页脚中的页面和日期的URL得到打印.我应该如何阻止他们进行打印?



It''s working fine but when i am printing In page header Page 1 of 1 gets print and in page footer the url of the page and date gets print. how should i stop them from printing??

推荐答案

hii

试试这个解决方案

http://forums.asp.net/t/1421429.aspx [ http://coding.smashingmagazine.com/2011 /11/24/how-to-set-up-a-print-style-sheet/ [ http://msdn.microsoft.com/en-us/library/aa969429%28v = vs.85%29.aspx [ ^ ]
hii

try this solutions

http://forums.asp.net/t/1421429.aspx[^]


http://coding.smashingmagazine.com/2011/11/24/how-to-set-up-a-print-style-sheet/[^]


http://msdn.microsoft.com/en-us/library/aa969429%28v=vs.85%29.aspx[^]



检查此
Hi ,
Check this
<script language="javascript" type="text/javascript">
    function CallPrint(strid) {
        var prtContent = document.getElementById(strid);
        var WinPrint = window.open('', '', 'letf=0,top=0,width=1,height=1,toolbar=0,scrollbars=0,status=0');
        WinPrint.document.write(prtContent.innerHTML);
        WinPrint.document.close();
        WinPrint.focus();
        WinPrint.print();
        WinPrint.close();
        prtContent.innerHTML = strOldOne;
    }
</script>





<div id ="bill">
<%-- the content will be printed --%>
</div>
<asp:button id="BtnPrint" runat="server" text="Print" onclientclick="javascript:CallPrint('bill');" xmlns:asp="#unknown" />


最好的问候
M.Mitwalli


Best regards
M.Mitwalli


你好,

我认为您指的是打印页面设置.请参考以下链接


http://www.mintprintables.com/print-tips/adjust-margins-windows/ [^ ]

http://browsers.about.com/od/firef2/ss/ffpagesetup.htm [ ^ ]

http://www.reedconstructiondata.com/help/smart-project-news/setting-up-smartproject-news-project-news-web-browser-and-print-options/ [
Hello,

I think you are referring to the print page setup. Please refer to the following links


http://www.mintprintables.com/print-tips/adjust-margins-windows/[^]

http://browsers.about.com/od/firef2/ss/ffpagesetup.htm[^]

http://www.reedconstructiondata.com/help/smart-project-news/setting-up-smartproject-news-project-news-web-browser-and-print-options/[^]


这篇关于打印面板内容时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆