Click here to Skip to main content
15,915,163 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I ahve already have some code to print the gridview,

Its not the problem.

When my gridview having more columns That time I need to print the gridview

into many pages, like for the first page 1-10 columns

for the second page 11-20 columns,

But I need to click only once the print button in the print dialog box.

What I have tried:

<script type="text/javascript">

function doPrint1() {

var prtContent = document.getElementById('<%=pnldetails1.ClientID %>');
prtContent.border = 1; //set no border here

var WinPrint = window.open();
WinPrint.document.write('<html><head><title></title></head>');
WinPrint.document.write('<body>');
WinPrint.document.write(prtContent.outerHTML);
WinPrint.document.write('</body></html>');
WinPrint.document.close();
WinPrint.focus();
WinPrint.print();
WinPrint.close();
window.close();
}
</script>
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900