这是我的代码,工作但我得到空白打印? 当我没有Logo作为图像时,我希望将上边距设置为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);
答案 0 :(得分:7)
你可以通过页面设置或类似的东西来做..
var setup = frmReport.reportViewer1.GetPageSettings();
setup.Margins = new System.Drawing.Printing.Margins(1, 1, 1, 1);
frmReport.reportViewer1.SetPageSettings(setup);