如何使用JSript代码打印日历视图? [英] How to Print Calendar Views using JSript code?
本文介绍了如何使用JSript代码打印日历视图?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们如何使用Java脚本或jscript在日历视图中*每月/每天/每周附加打印功能. ?任何例子.
How can we attach print feature in calendar views*monthly/daily/weekly using java script or jscript. ? any example.
谢谢
推荐答案
您可以通过以下Javascript进行尝试;
You can try it through Javascript as below;
function doPrint() {
// Get body
bdhtml=window.document.body.innerHTML;
// Set start type where you want to start print
sprnstr="<!--startprint-->";
// Set end type where you want to end print
eprnstr="<!--endprint-->";
prnhtml=bdhtml.substr(bdhtml.indexOf(sprnstr)+17);
prnhtml=prnhtml.substring(0,prnhtml.indexOf(eprnstr));
window.document.body.innerHTML=prnhtml;
// print
window.print();
}
这篇关于如何使用JSript代码打印日历视图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文