6

这是我的代码,工作但我得到空白打印?当我没有徽标作为图像时,我想将上边距设置为 0。

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);
4

1 回答 1

8

你可以通过页面设置或类似的东西来做..

var setup = frmReport.reportViewer1.GetPageSettings();           
setup.Margins = new System.Drawing.Printing.Margins(1, 1, 1, 1);
frmReport.reportViewer1.SetPageSettings(setup);
于 2015-04-07T13:19:13.623 回答