Good afternoon guys, I have a report that is generated on a page aspx
with bootstrap
and CSS
. The content of the report is within div <div id="pdf2htmldiv">...</div>
where I call via javascript for printing. But the page is displayed for printing without the style
of the page. Do you have any way to print this report as it appears with style CSS
?
javascript code:
<script>
function printDiv(divName) {
var printContents = document.getElementById(divName).innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
}
</script>
Button Call:
<input type="button" onclick="printDiv('pdf2htmldiv')" value="Imprimir" />
Page Content:
<div id="pdf2htmldiv">
\conteúdo do relatório
</div>
Reporttoprint:
The stylo of the zebrada
table does not appear even the edges of the report. Can I print according to the first image?