我有一个简单的本地rdlc,页面单位= in,orientation = landscape和paper size = A4 w = 11.69 h = 8.27
当我尝试使用
检索报告时var paperSize = report.GetDefaultPageSettigs().PaperSize;
我得到以下返回{[PaperSize A4 Kind = A4 Height = 1169 Width = 827]}
我做错了什么?
答案 0 :(得分:0)
你没有做错任何事。
从下面的msdn链接可以看出: -
http://msdn.microsoft.com/en-us/library/system.drawing.printing.papersize%28v=vs.100%29.aspx
高度和宽度值以百分之一英寸为单位返回。
检查PaperSize.IsLandscape是否返回true
答案 1 :(得分:0)
Dim ps As New PageSettings() 'Declare a new PageSettings for printing
ps.Landscape = True 'Set True for landscape, False for Portrait
ps.Margins = New Margins(0, 0, 0, 0) 'Set margins
'Choose paper size from the paper sizes defined in ur printer.
'Here we use Linq to quickly choose by name
ps.PaperSize = (From p In ps.PrinterSettings.PaperSizes Where p.PaperName = "A4").First()
'Alternatively you can set the paper size as custom
'ps.PaperSize = new PaperSize("MyPaperSize", 827, 1169);
ReportViewer1.SetPageSettings(ps)
ReportViewer1.SetDisplayMode(DisplayMode.PrintLayout)
'Refresh the report
Me.ReportViewer1.RefreshReport()