/// <summary> /// 客户尺寸 /// </summary> private void ExecutePrintCustomerSize() { _paperSize = SettleBillPaperSize.CustomerSize; LoadStockOutDetailReport(_paperSize); }
/// <summary> /// A4尺寸充满 /// </summary> private void ExecutePrintA4SizeFull() { _paperSize = SettleBillPaperSize.A4SizeFull; LoadStockOutDetailReport(_paperSize); }
/// <summary> /// 加载页面 /// </summary> /// <param name="paramBillPaperSize"></param> private void LoadStockOutDetailReport(SettleBillPaperSize paramBillPaperSize) { reportViewer1.Reset(); string rdlcFileName = string.Empty; switch (paramBillPaperSize) { case SettleBillPaperSize.CustomerSize: rdlcFileName = "RPT_ViewAndPrintStockOutDetailReport2228_" + @".rdlc"; break; case SettleBillPaperSize.A4Size: rdlcFileName = "RPT_ViewAndPrintStockOutDetailReport_" + @".rdlc"; break; case SettleBillPaperSize.A5Size: rdlcFileName = "RPT_ViewAndPrintStockOutDetailReportA5_" + @".rdlc"; break; case SettleBillPaperSize.A4SizeFull: rdlcFileName = "RPT_ViewAndPrintStockOutDetailReportA4Full_" + @".rdlc"; break; } string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName; if (!File.Exists(reportFilePath)) { switch (paramBillPaperSize) { case SettleBillPaperSize.CustomerSize: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintStockOutDetailReport2228.rdlc"; break; case SettleBillPaperSize.A4Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintStockOutDetailReport.rdlc"; break; case SettleBillPaperSize.A5Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintStockOutDetailReportA5.rdlc"; break; case SettleBillPaperSize.A4SizeFull: reportFilePath = Application.StartupPath + @"\RdlcFiles\RPT_ViewAndPrintStockOutDetailReportA4Full.rdlc"; break; } } if (File.Exists(reportFilePath)) { reportViewer1.LocalReport.ReportPath = reportFilePath; reportViewer1.LocalReport.DataSources.Clear(); ReportDataSource rpd1 = new ReportDataSource("StockOutDetail", _stockOutDetailList 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> /// A4尺寸充满 /// </summary> private void ExecutePrintA4SizeFull() { _paperSize = SettleBillPaperSize.A4SizeFull; LoadSettleBill(_paperSize); }
/// <summary> /// 加载页面 /// </summary> /// <param name="paramBillPaperSize"></param> private void LoadSettleBill(SettleBillPaperSize paramBillPaperSize) { reportViewer1.Reset(); string rdlcFileName = string.Empty; switch (paramBillPaperSize) { case SettleBillPaperSize.CustomerSize: rdlcFileName = "FM_ViewAndPrintReceiptBill2228_" + @".rdlc"; break; case SettleBillPaperSize.A4Size: rdlcFileName = "FM_ViewAndPrintReceiptBill_" + @".rdlc"; break; case SettleBillPaperSize.A5Size: rdlcFileName = "FM_ViewAndPrintReceiptBillA5_" + @".rdlc"; break; case SettleBillPaperSize.A4SizeFull: rdlcFileName = "FM_ViewAndPrintReceiptBillA4Full_" + @".rdlc"; break; } string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName; if (!File.Exists(reportFilePath)) { switch (paramBillPaperSize) { case SettleBillPaperSize.CustomerSize: reportFilePath = Application.StartupPath + @"\RdlcFiles\FM_ViewAndPrintReceiptBill2228.rdlc"; break; case SettleBillPaperSize.A4Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\FM_ViewAndPrintReceiptBill.rdlc"; break; case SettleBillPaperSize.A5Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\FM_ViewAndPrintReceiptBillA5.rdlc"; break; case SettleBillPaperSize.A4SizeFull: reportFilePath = Application.StartupPath + @"\RdlcFiles\FM_ViewAndPrintReceiptBillA4Full.rdlc"; break; } } if (File.Exists(reportFilePath)) { reportViewer1.LocalReport.ReportPath = reportFilePath; reportViewer1.LocalReport.DataSources.Clear(); List <ReceiptBillUIModelToPrint> receiptBillList = new List <ReceiptBillUIModelToPrint> { _receiptBill }; ReportDataSource rpd1 = new ReportDataSource(FMViewParamKey.ReceiptBill.ToString(), receiptBillList as object); reportViewer1.LocalReport.DataSources.Add(rpd1); ReportDataSource rpd2 = new ReportDataSource(FMViewParamKey.ReceiptBillDetail.ToString(), _receiptBillDetailList as object); reportViewer1.LocalReport.DataSources.Add(rpd2); ReportParameter rp1 = new ReportParameter("Org_Name", LoginInfoDAX.User_PrintTitlePrefix); reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1 }); reportViewer1.SetDisplayMode(DisplayMode.PrintLayout); reportViewer1.ZoomMode = ZoomMode.Percent; reportViewer1.ZoomPercent = 100; reportViewer1.Refresh(); } else { MessageBoxs.Show(Trans.FM, this.ToString(), MsgHelp.GetMsg(MsgCode.E_0010, new object[] { SystemActionEnum.Name.PRINT }), MessageBoxButtons.OK, MessageBoxIcon.Error); return; } }
/// <summary> /// 客户尺寸 /// </summary> private void ExecutePrintCustomerSize() { _paperSize = SettleBillPaperSize.CustomerSize; LoadSettleBill(_paperSize); }
/// <summary> /// A5尺寸 /// </summary> private void ExecutePrintA5Size() { _paperSize = SettleBillPaperSize.A5Size; LoadSettleBill(_paperSize); }
/// <summary> /// A5尺寸 /// </summary> private void ExecutePrintA5Size() { _paperSize = SettleBillPaperSize.A5Size; LoadStockInTotalReport(_paperSize); }
/// <summary> /// A4尺寸 /// </summary> private void ExecutePrintA4Size() { _paperSize = SettleBillPaperSize.A4Size; LoadStockInDetailReport(_paperSize); }
/// <summary> /// 加载页面 /// </summary> /// <param name="paramBillPaperSize"></param> private void LoadPurchaseOrder(SettleBillPaperSize paramBillPaperSize) { reportViewer1.Reset(); string rdlcFileName = string.Empty; switch (paramBillPaperSize) { case SettleBillPaperSize.CustomerSize: rdlcFileName = "PIS_ViewAndPrintPurchaseOrder2228_" + @".rdlc"; break; case SettleBillPaperSize.A4Size: rdlcFileName = "PIS_ViewAndPrintPurchaseOrder_" + @".rdlc"; break; case SettleBillPaperSize.A5Size: rdlcFileName = "PIS_ViewAndPrintPurchaseOrderA5_" + @".rdlc"; break; case SettleBillPaperSize.A4SizeFull: rdlcFileName = "PIS_ViewAndPrintPurchaseOrderA4Full_" + @".rdlc"; break; } string reportFilePath = Application.StartupPath + @"\RdlcFiles\" + rdlcFileName; if (!File.Exists(reportFilePath)) { switch (paramBillPaperSize) { case SettleBillPaperSize.CustomerSize: reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintPurchaseOrder2228.rdlc"; break; case SettleBillPaperSize.A4Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintPurchaseOrder.rdlc"; break; case SettleBillPaperSize.A5Size: reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintPurchaseOrderA5.rdlc"; break; case SettleBillPaperSize.A4SizeFull: reportFilePath = Application.StartupPath + @"\RdlcFiles\PIS_ViewAndPrintPurchaseOrderA4Full.rdlc"; break; } } if (File.Exists(reportFilePath)) { reportViewer1.LocalReport.ReportPath = reportFilePath; reportViewer1.LocalReport.DataSources.Clear(); List <PurchaseOrderUIModelToPrint> billList = new List <PurchaseOrderUIModelToPrint> { _purchaseOrder }; ReportDataSource rpd1 = new ReportDataSource(PISViewParamKey.PurchaseOrder.ToString(), billList as object); reportViewer1.LocalReport.DataSources.Add(rpd1); ReportDataSource rpd2 = new ReportDataSource(PISViewParamKey.PurchaseOrderDetail.ToString(), _purchaseOrderDetailList as object); reportViewer1.LocalReport.DataSources.Add(rpd2); ReportParameter rp1 = new ReportParameter("Org_Name", LoginInfoDAX.User_PrintTitlePrefix); this.reportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp1 }); //设置打印布局模式,显示物理页面大小 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> /// A4尺寸充满 /// </summary> private void ExecutePrintA4SizeFull() { _paperSize = SettleBillPaperSize.A4SizeFull; LoadPurchaseOrder(_paperSize); }
/// <summary> /// A5尺寸 /// </summary> private void ExecutePrintA5Size() { _paperSize = SettleBillPaperSize.A5Size; LoadPurchaseOrder(_paperSize); }