0

I have a gridview in a div and I am printing this div without a problem but when gridview fills the first page, page divides gridview from some part of a row. As you can see, last line of the row displayed in the second page.

I wonder if there is a way to fix this?

Edit: I want to share my printing method since it has been asked. My javascript method for printing the div which contains my gridview:

function CallPrint(strid) {
                    var prtContent = document.getElementById(strid);
                    var WinPrint = window.open('', '', 'letf=0,top=0,width=800,height=100,toolbar=0,scrollbars=0,status=0,dir=rtl');
                    WinPrint.document.write(prtContent.innerHTML);
                    WinPrint.document.close();
                    WinPrint.focus();
                    WinPrint.print();
                    WinPrint.close();
                    prtContent.innerHTML = strOldOne;
                }

And my print button in .aspx:

<asp:Button OnClientClick="javascript:CallPrint('divPrint');" ID="btnTeklifOnayla" runat="server" Text="Teklifi Onayla" CssClass="btn btn-success"/>
Koray Durudogan
  • 624
  • 4
  • 12
  • 31

1 Answers1

0

Check your page setting this is not a programming issue, the page you are printing has data which need more than one page. You have two options here either reduce size of content or change page setup to Legal size.

use This link to set papersize programmatically. If you want to force data to move on next page use This Link

Community
  • 1
  • 1
Vijay Kumbhoje
  • 1,401
  • 2
  • 25
  • 44
  • But gridview size changes everytime. I mean one page can be enough too. Is there a way to, for example print 3 rows in a page and then continue with other page ? – Koray Durudogan Dec 09 '15 at 13:50