Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set Page margin in reportviewer?

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);
like image 611
user2769236 Avatar asked Sep 30 '13 20:09

user2769236


1 Answers

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);
like image 154
PachecoDt Avatar answered Sep 20 '22 23:09

PachecoDt