简体   繁体   English

使用window.print()函数打印(* .rdlc)文件

[英]Printing (*.rdlc) file with window.print() function

I am trying to print a edited Report.rdlc file with a datasource. 我正在尝试使用数据源打印已编辑的Report.rdlc文件。 There is not a problem about this report file. 此报告文件没有问题。 But, I couldn't give file name as parameter of the window.print() function. 但是,我无法将文件名作为window.print()函数的参数。 Is there a solution giving parameter in window.print() function or a working script. 是否有在window.print()函数或工作脚本中提供参数的解决方案? Even a text file as a parameter works for me. 甚至一个文本文件作为参数对我也有效。

You can not pass the parameter to window.print function.but you can use below method to print only the part of page you need. 您不能将参数传递给window.print函数。但是您可以使用以下方法仅打印所需页面的一部分。

    function printIt(printThis) {
      var win = window.open();
      var dv=document.getElementById("printThis");
      self.focus();
      win.document.open();
      win.document.write('<'+'html'+'><'+'body'+'>');
      win.document.write(dv.innerHTML);
      win.document.write('<'+'/body'+'><'+'/html'+'>');
      win.document.close();
      win.print();
      win.close();
    }

check the link 检查链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM