如何設置PDF導出的格局?報告查看器Landscape PDF導出
刷新前無法使用System.Drawing.Printing.PageSettings。
Type tip = reportViewer1.GetType();
FieldInfo[] pr = tip.GetFields(BindingFlags.Instance | BindingFlags.NonPublic);
System.Drawing.Printing.PageSettings ps = new System.Drawing.Printing.PageSettings();
ps.Landscape = true;
// ps.PaperSource=
foreach (FieldInfo item in pr)
{
if (item.Name == "m_pageSettings")
{
item.SetValue(reportViewer1, ps);
}
}
檢查此帖:http://stackoverflow.com/questions/25387415/export-rdlc-report-to-pdf-in-景觀模式 – 2014-11-05 20:21:52