winforms - How to print multiple datagridview's using printdocument c# -
i have winform app show user 3 different datagridviews relevant data enquiring about. have allowed user select grids print out. can print first page fine after index error. want setup other print out 1 dialog box , print out in 1 document. example if select 3 3 pages print. if select 1 one. if select 2 2 print. how beyond first page can add other grids?
print button click event:
printdialog printdialog = new printdialog(); printdialog.document = printdocument1; printdialog.document = printdocument2; printdialog.document = printdocument3; printdialog.useexdialog = true; if (dialogresult.ok == printdialog.showdialog()) { if (chkboxbyscale.checked) { printdocument1.documentname = "project report"; printdocument1.print(); } if (chkboxbyuser.checked) { printdocument2.documentname = "project report 2"; printdocument2.print(); } if (chkboxbyline.checked) { printdocument3.documentname = "project report 3"; printdocument3.print(); } }
if want me provide nay of printbegin or printpage let me know. seemed lengthy posting all.
Comments
Post a Comment