/// <summary> /// 加载页面 /// </summary> /// <param name="paramBillTotalPaperSize"></param> private void LoadSalesPerformanceTotalReport(SalesPerformanceTotalPaperSize paramBillTotalPaperSize) { reportViewer1.Reset(); string rdlcFileName = string.Empty; switch (paramBillTotalPaperSize) { case SalesPerformanceTotalPaperSize.CustomerSize: rdlcFileName = "RPT_ViewAndPrintSalesPerformanceTotalReport2228_" + @".rdlc"; break; case SalesPerformanceTotalPaperSize.A4Size: rdlcFileName = "RPT_ViewAndPrintSalesPerformanceTotalReport_" + @".rdlc"; break; case SalesPerformanceTotalPaperSize.A5Size: rdlcFileName = "RPT_ViewAndPrintSalesPerformanceTotalReportA5_" + @".rdlc"; break; case SalesPerformanceTotalPaperSize.A4SizeFull: rdlcFileName = "RPT_ViewAndPrintSalesPerformanceTotalReportA4Full_" + @".rdlc"; break; } string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName; if (!File.Exists(reportFilePath)) { switch (paramBillTotalPaperSize) { case SalesPerformanceTotalPaperSize.CustomerSize: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintSalesPerformanceTotalReport2228.rdlc"; break; case SalesPerformanceTotalPaperSize.A4Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintSalesPerformanceTotalReport.rdlc"; break; case SalesPerformanceTotalPaperSize.A5Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintSalesPerformanceTotalReportA5.rdlc"; break; case SalesPerformanceTotalPaperSize.A4SizeFull: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintSalesPerformanceTotalReportA4Full.rdlc"; break; } } if (File.Exists(reportFilePath)) { reportViewer1.LocalReport.ReportPath = reportFilePath; reportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rpd1 = new ReportDataSource("SalesPerformanceTotal", _salesPerformanceTotalList as object); reportViewer1.LocalReport.DataSources.Add(rpd1); //设置打印布局模式,显示物理页面大小 reportViewer1.SetDisplayMode(DisplayMode.PrintLayout); //缩放模式为百分比,以100%方式显示 reportViewer1.ZoomMode = ZoomMode.Percent; reportViewer1.ZoomPercent = 100; reportViewer1.RefreshReport(); reportViewer1.Refresh(); } else { MessageBoxs.Show(Trans.PIS, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.PRINT }), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
/// <summary> /// 客户尺寸 /// </summary> private void ExecutePrintCustomerSize() { _totalPaperSize = SalesPerformanceTotalPaperSize.CustomerSize; LoadSalesPerformanceTotalReport(_totalPaperSize); }
/// <summary> /// A4尺寸充满 /// </summary> private void ExecutePrintA4SizeFull() { _totalPaperSize = SalesPerformanceTotalPaperSize.A4SizeFull; LoadSalesPerformanceTotalReport(_totalPaperSize); }