1
我試圖用iframe和div打印div數據包含網格與分頁當我打印div使用js只有幾個記錄打印在.xps文件..爲什麼它如此...iframe數據打印不正確
這裏是IFRAME:
<iframe id='ifrmPr' src='#'style="width:100%;height:100%;display:block;border:none;ackground:transparent">
</iframe>
這裏是我的js代碼打印DIV
var ifrm = document.getElementById('ifrmPr');
var content = document.getElementById('PrintSection').innerHTML;
/* Determine what DOM model to use */
var printDoc = (ifrm.contentWindow || ifrm.contentDocument);
if (printDoc.document) {
printDoc = printDoc.document;
}
/* Create a HTML document to go into the iFrame */
/* The title will appear on the printed document */
printDoc.write("<html><head><title>title</title>");
printDoc.write("<link rel='stylesheet' type='text/css' href='../../Content/pageElement.css' />");
printDoc.write("<link rel='stylesheet' type='text/css' href='../../Content/Site.css' />");
printDoc.write("<link rel='stylesheet' type='text/css' href='../../Content/style.css' />");
printDoc.write("</head><body onload='this.focus(); this.print();'>");
printDoc.write(content + "</body></html>");
printDoc.close();
打印輸出中有* *號*什麼? – Pointy 2012-03-13 13:16:03
某些數據在.xps文件中丟失。 – user1194147 2012-03-15 06:11:02