Click here to Skip to main content
15,897,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my problem was, i have to print invoice copy(8.5*11 inch) and delivery(half of a4 size )(8.5 * 6 inch)
in dot matrix printer. I want to print both in same dot matrix printer. how to give printer setting fro both report .
i am using c# window application.

What I have tried:

System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
pg.Margins.Top = 1;
pg.Margins.Bottom = 1;
pg.Margins.Left = 1;
pg.Margins.Right = 1;
System.Drawing.Printing.PaperSize size = new System.Drawing.Printing.PaperSize();
size.PaperName = "Custom";
reportViewer1.SetPageSettings(pg);
Posted
Updated 12-Apr-16 21:36pm

Your PaperSize size is not connected to PageSettings pg. Attach one to the other.
C#
size.PaperName = "Custom";
pg.PaperSize = size;
reportViewer1.SetPageSettings(pg);
 
Share this answer
 
Go through the below link.

Click Here
 
Share this answer
 

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