Here is my code, working but i am getting blank printing ? I want set Top margin as 0 when i dont have Logo as Image.
System.Drawing.Printing.PageSettings pg = new System.Drawing.Printing.PageSettings();
pg.Margins.Top = 0;
pg.Margins.Bottom = 0;
pg.Margins.Left = 100;
pg.Margins.Right = 50;
System.Drawing.Printing.PaperSize size = new PaperSize();
size.RawKind = (int)PaperKind.A4Extra;
pg.PaperSize = size;
reportViewer1.SetPageSettings(pg);
you can do by the Page Settings or something like this..
var setup = frmReport.reportViewer1.GetPageSettings();
setup.Margins = new System.Drawing.Printing.Margins(1, 1, 1, 1);
frmReport.reportViewer1.SetPageSettings(setup);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With