void printMethod(string SendNo) { Report.ReportTable4 report = new Report.ReportTable4(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.printSendInfo_SP1.sp_SelectPrintSendInfo, SendNo); MainPreview.Model = new XtraReportPreviewModel(report); var model = visaORM.SendInfo.FirstOrDefault(s => s.FSendNo == SendNo); if (model != null) { report.xrLabelDSN.Text = model.FDSN; report.xrLabelComapny.Text = model.FVietnamCompany; } else { report.xrLabelDSN.Text = ""; report.xrLabelComapny.Text = ""; } report.xrLabelCaption.Text = "表格四"; DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); }
private void Load_rptWare_Muahang_Congno_Tra() { try { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } DataSet ds_Congnotra = objWareService.Get_RptWare_Muahang_Congno_Tra(dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue, lookUpEdit_Doituong.EditValue).ToDataSet(); Ecm.Reports.XtraReports.rptWare_Muahang_Congno_Tra _rptWare_Muahang_Congno_Tra = new Ecm.Reports.XtraReports.rptWare_Muahang_Congno_Tra(); // Thiết lập hệ số chương trình (Logo, thông tin công ty) setHesoChuongtrinh(_rptWare_Muahang_Congno_Tra.xrc_CompanyName, _rptWare_Muahang_Congno_Tra.xrc_CompanyAddress, _rptWare_Muahang_Congno_Tra.xrPic_Logo); _rptWare_Muahang_Congno_Tra.xrTable_tungay.Text = dtNgay_Batdau.DateTime.ToString("dd/MM/yyyy"); _rptWare_Muahang_Congno_Tra.xrTable_Denngay.Text = dtNgay_Ketthuc.DateTime.ToString("dd/MM/yyyy"); _rptWare_Muahang_Congno_Tra.xrTable_Ngay.Text = DateTime.Today.Day.ToString(); _rptWare_Muahang_Congno_Tra.xrTable_Thang.Text = DateTime.Today.Month.ToString(); _rptWare_Muahang_Congno_Tra.xrTable_Nam.Text = DateTime.Today.Year.ToString(); _rptWare_Muahang_Congno_Tra.DataSource = ds_Congnotra; GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _rptWare_Muahang_Congno_Tra; _rptWare_Muahang_Congno_Tra.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Muahang_Congno_Tra); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _rptWare_Muahang_Congno_Tra.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Muahang_Congno_Tra); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif } }
private void Load_Rptware_Banhang_Congno_Tonghop() { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); //hashtableControls.Add(lookUpEditCuahang_Ban, lblCuahang_Ban.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } XtraReports.rptWare_Banhang_Congno_Tonghop _rptWare_Banhang_Congno_Tonghop = new Ecm.Reports.XtraReports.rptWare_Banhang_Congno_Tonghop(); GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _rptWare_Banhang_Congno_Tonghop; // Thiết lập hệ số chương trình (Logo, thông tin công ty) setHesoChuongtrinh(_rptWare_Banhang_Congno_Tonghop.xrc_CompanyName, _rptWare_Banhang_Congno_Tonghop.xrc_CompanyAddress, null); DataSet dsReport = objReportService.Rptware_Banhang_Congno_Tonghop_Khuvuc_New(dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue, lookUpEdit_Khachhang.Text, lookUpEditCuahang_Ban.EditValue).ToDataSet(); _rptWare_Banhang_Congno_Tonghop.DataSource = dsReport; _rptWare_Banhang_Congno_Tonghop.xrTableCell_DateFrom.Text = dtNgay_Batdau.Text; _rptWare_Banhang_Congno_Tonghop.xrTableCell_DateTo.Text = dtNgay_Ketthuc.Text; _rptWare_Banhang_Congno_Tonghop.xrTable_Ngay.Text = DateTime.Today.Day.ToString(); _rptWare_Banhang_Congno_Tonghop.xrTable_Thang.Text = DateTime.Today.Month.ToString(); _rptWare_Banhang_Congno_Tonghop.xrTable_Nam.Text = DateTime.Today.Year.ToString(); //setNgay_Thang_Nam(_rptWare_Banhang_Congno_Tonghop.xrTable_Ngay, _rptWare_Banhang_Congno_Tonghop.xrTable_Thang, _rptWare_Banhang_Congno_Tonghop.xrTable_Nam); _rptWare_Banhang_Congno_Tonghop.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Banhang_Congno_Tonghop); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _rptWare_Banhang_Congno_Tonghop.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Banhang_Congno_Tonghop); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); }
private void Load_Rptware_Tonghop_Hoadon_Muahang_Thue() { try { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } DataSet dsReport = objReportService.Rptware_Tonghop_Hoadon_Muahang_Thue(dtNgay_Batdau.EditValue, dtNgay_Ketthuc.DateTime.AddHours(23).AddMinutes(59).AddSeconds(59)).ToDataSet(); Ecm.Reports.XtraReports.rptWare_Tonghop_Hoadon_Muahang_Thue _rptWare_Tonghop_Hoadon_Muahang_Thue = new Ecm.Reports.XtraReports.rptWare_Tonghop_Hoadon_Muahang_Thue(); setHesoChuongtrinh(_rptWare_Tonghop_Hoadon_Muahang_Thue.xrc_CompanyName, _rptWare_Tonghop_Hoadon_Muahang_Thue.xrc_CompanyAddress, _rptWare_Tonghop_Hoadon_Muahang_Thue.xrPic_Logo); // Thiết lập hệ số chương trình (Logo, thông tin công ty) _rptWare_Tonghop_Hoadon_Muahang_Thue.Parameters["Tungay"].Value = dtNgay_Batdau.Text; _rptWare_Tonghop_Hoadon_Muahang_Thue.Parameters["Denngay"].Value = dtNgay_Ketthuc.Text; _rptWare_Tonghop_Hoadon_Muahang_Thue.DataSource = dsReport; GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _rptWare_Tonghop_Hoadon_Muahang_Thue; _rptWare_Tonghop_Hoadon_Muahang_Thue.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Tonghop_Hoadon_Muahang_Thue); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _rptWare_Tonghop_Hoadon_Muahang_Thue.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Tonghop_Hoadon_Muahang_Thue); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif } }
private void txtPrintSingle_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, this.txtPrintSingle.Text); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report1(this.txtPrintSingle.Text)); } }
private void simpleButton1_Click(object sender, EventArgs e) { XtraReport_TD rpt = new XtraReport_TD(""); DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(rpt); // DevExpress.XtraPrinting.PrintingSystemBase mPSB = printTool.PrintingSystem; mPSB.SetCommandVisibility(new DevExpress.XtraPrinting.PrintingSystemCommand[] //{ // DevExpress.XtraPrinting.PrintingSystemCommand.Background , // DevExpress.XtraPrinting.PrintingSystemCommand.ClosePreview , // DevExpress.XtraPrinting.PrintingSystemCommand.Customize , // DevExpress.XtraPrinting.PrintingSystemCommand.DocumentMap , // DevExpress.XtraPrinting.PrintingSystemCommand.File , // DevExpress.XtraPrinting.PrintingSystemCommand.FillBackground , // DevExpress.XtraPrinting.PrintingSystemCommand.Open , // DevExpress.XtraPrinting.PrintingSystemCommand.PageSetup , // DevExpress.XtraPrinting.PrintingSystemCommand.Print , // DevExpress.XtraPrinting.PrintingSystemCommand.PrintDirect , // DevExpress.XtraPrinting.PrintingSystemCommand.Save, // DevExpress.XtraPrinting.PrintingSystemCommand.Watermark, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportCsv, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportFile, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportGraphic, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportHtm, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportMht, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportPdf, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportRtf, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportTxt, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportXls, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportXlsx, // DevExpress.XtraPrinting.PrintingSystemCommand.ExportXps, // DevExpress.XtraPrinting.PrintingSystemCommand.SendCsv, // DevExpress.XtraPrinting.PrintingSystemCommand.SendFile, // DevExpress.XtraPrinting.PrintingSystemCommand.SendGraphic, // DevExpress.XtraPrinting.PrintingSystemCommand.SendMht, // DevExpress.XtraPrinting.PrintingSystemCommand.SendPdf, // DevExpress.XtraPrinting.PrintingSystemCommand.SendRtf, // DevExpress.XtraPrinting.PrintingSystemCommand.SendTxt, // DevExpress.XtraPrinting.PrintingSystemCommand.SendXls, // DevExpress.XtraPrinting.PrintingSystemCommand.SendXlsx, // DevExpress.XtraPrinting.PrintingSystemCommand.SendXps, // DevExpress.XtraPrinting.PrintingSystemCommand.SubmitParameters // }, DevExpress.XtraPrinting.CommandVisibility.None); //printTool.ShowPreviewDialog(); printTool.Print(); }
void FetchData2Print() { lock (this) { LoadData(); try { if (DateTime.Compare(dtlc_bar_table_order_chitiet, dtlc_bar_table_order_chitiet_temp) != 0 || DateTime.Compare(dtlc_bar_rent_checkin_table_hanghoa, dtlc_bar_rent_checkin_table_hanghoa_temp) != 0) { dsPrinters = objBarService.GetPrinter_From_Bar_Kitchen_Printer(txtPc_Code.Text).ToDataSet(); dsKitchen_Order_Chitiet = objBarService.FetchPrinter_Bar_Kitchen_Order_Chitiet(txtPc_Code.Text, lookUpEdit_Cuahang_Ban.EditValue).ToDataSet(); //dgBar_Kitchen_Printer.DataSource = dsKitchen_Order_Chitiet.Tables[0]; dtlc_bar_table_order_chitiet_temp = dtlc_bar_table_order_chitiet; dtlc_bar_rent_checkin_table_hanghoa_temp = dtlc_bar_rent_checkin_table_hanghoa; if (dsKitchen_Order_Chitiet.Tables[0].Rows.Count > 0) { foreach (DataRow drprinter in dsPrinters.Tables[0].Rows) { DataRow[] sdrKitchen_Order = dsKitchen_Order_Chitiet.Tables[0].Select(string.Format("Printer = '{0}'", drprinter["Printer"])); if (sdrKitchen_Order.Length > 0) { DataSets.DsBar_Kitchen_Order_Chitiet dsKitchen_Order = new Ecm.Bar.DataSets.DsBar_Kitchen_Order_Chitiet(); Reports.RptBar_Kitchen_Order_Chitiet rptKitchen_Order = new Ecm.Bar.Reports.RptBar_Kitchen_Order_Chitiet(); foreach (DataRow drKitchen_Order in sdrKitchen_Order) { dsKitchen_Order.Tables[0].ImportRow(drKitchen_Order); } rptKitchen_Order.DataSource = dsKitchen_Order; rptKitchen_Order.PrinterName = "" + drprinter["Printer"]; var reportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rptKitchen_Order); reportPrintTool.Print(); } } } } } catch (Exception ex) { GoobizFrame.Windows.TrayMessage.TrayMessage.Status = new GoobizFrame.Windows.TrayMessage.TrayMessageInfo(MessageBoxIcon.Warning, ex.Message, ex.ToString()); } } }
private void Load_Rptware_Muahang_Xuattra_Chitiet() { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); hashtableControls.Add(lookUpEditCuahang_Ban, lblCuahang_Ban.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } XtraReports.rptWare_Muahang_Xuattra_Chitiet _rptWare_Muahang_Xuattra_Chitiet = new Ecm.Reports.XtraReports.rptWare_Muahang_Xuattra_Chitiet(); // Thiết lập hệ số chương trình (Logo, thông tin công ty) setHesoChuongtrinh(_rptWare_Muahang_Xuattra_Chitiet.xrc_CompanyName, _rptWare_Muahang_Xuattra_Chitiet.xrc_CompanyAddress, _rptWare_Muahang_Xuattra_Chitiet.xrPic_Logo); _rptWare_Muahang_Xuattra_Chitiet.Parameters["Kho"].Value = lookUpEditCuahang_Ban.Text; _rptWare_Muahang_Xuattra_Chitiet.Parameters["Tungay"].Value = dtNgay_Batdau.Text; _rptWare_Muahang_Xuattra_Chitiet.Parameters["Denngay"].Value = dtNgay_Ketthuc.Text; DataSet dsReport = objReportService.Rptware_Muahang_Xuattra_Chitiet(dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue, lookUpEditCuahang_Ban.EditValue, lookUpEdit_Doituong.EditValue).ToDataSet(); _rptWare_Muahang_Xuattra_Chitiet.DataSource = dsReport; GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _rptWare_Muahang_Xuattra_Chitiet; _rptWare_Muahang_Xuattra_Chitiet.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Muahang_Xuattra_Chitiet); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _rptWare_Muahang_Xuattra_Chitiet.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Muahang_Xuattra_Chitiet); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); }
public Report1(List <string> printID) { InitializeComponent(); string keyString = ""; foreach (string autoID in printID) { keyString += autoID + ","; } Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, keyString); MainPreview.Model = new XtraReportPreviewModel(report); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); report.CreateDocument(); }
private void btnPrint_CopyVer_Click(object sender, EventArgs e) { this.DoClickEndEdit(dgBar_Kitchen_Order_Chitiet_Top); DataRow[] sdrKitchen_Order = dsBar_Kitchen_Order_Chitiet_Top.Tables[0].Select(string.Format("Chon = '{0}'", true)); if (sdrKitchen_Order.Length > 0) { DataSets.DsBar_Kitchen_Order_Chitiet dsKitchen_Order = new Ecm.Bar.DataSets.DsBar_Kitchen_Order_Chitiet(); Reports.RptBar_Kitchen_Order_Chitiet rptKitchen_Order = new Ecm.Bar.Reports.RptBar_Kitchen_Order_Chitiet(); foreach (DataRow drKitchen_Order in sdrKitchen_Order) { drKitchen_Order["Copy_Ver"] = "COPY"; dsKitchen_Order.Tables[0].ImportRow(drKitchen_Order); } rptKitchen_Order.DataSource = dsKitchen_Order; var reportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rptKitchen_Order); reportPrintTool.Print(); } }
public Report1(List<string> printID) { InitializeComponent(); string keyString = ""; foreach (string autoID in printID) { keyString += autoID + ","; } Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, keyString); MainPreview.Model = new XtraReportPreviewModel(report); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); report.CreateDocument(); }
void printVisa() { try { if (cbSubmitList.SelectedItem == null) { MessageBox.Show("请先选择已提交名单"); return; } string submitNo = cbSubmitList.SelectedItem.ToString(); string keyString = ""; var visaModelArray = visaORM.TB_TableSubmit.Where(s => s.FSubmitNo == submitNo); //List<string> ids = new List<string>(); foreach (var visaModel in visaModelArray) { keyString += visaModel.FAutoID + ","; //ids.Add(visaModel.FAutoID); } //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report1(ids)); Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, keyString); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report2(MainContext.UserCompanyName, newSubmitNo)); } catch (System.Exception ex) { MessageBox.Show(ex.Message); Log.WriteLog.WriteErorrLog(ex); } }
public void PrintListBarcode(DataTable listBarcode) { try { View.RegistBarcodes.rptListBarcode _report = new View.RegistBarcodes.rptListBarcode(); _report.DataSource = listBarcode; if (GeneralHelper.ValidPrinter(GlobalConstants.printerName)) { _report.PrinterName = GlobalConstants.printerName; DevExpress.XtraReports.UI.ReportPrintTool rpt = new DevExpress.XtraReports.UI.ReportPrintTool(_report); rpt.AutoShowParametersPanel = false; rpt.Print(); } else { DevExpress.XtraReports.UI.ReportPrintTool rpt = new DevExpress.XtraReports.UI.ReportPrintTool(_report); rpt.AutoShowParametersPanel = false; rpt.ShowPreview(); } } catch { } }
public override bool PerformPrintPreview() { Ecm.Bar.DataSets.dsHdbanhang_Chitiet dsrHdbanhang_Chitiet = new Ecm.Bar.DataSets.dsHdbanhang_Chitiet(); Ecm.Bar.Reports.rptHdbanhang_noVAT rptHdbanhang_noVAT = new Ecm.Bar.Reports.rptHdbanhang_noVAT(); // GoobizFrame.Windows.Forms.FrmPrintPreview frmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); GoobizFrame.Windows.Forms.FrmPrintPreview frmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); frmPrintPreview.Report = rptHdbanhang_noVAT; //frmPrintPreview.Name = this.Name; //frmPrintPreview.EnablePrintPreview = this.EnablePrintPreview; rptHdbanhang_noVAT.DataSource = dsrHdbanhang_Chitiet; int i = 1; foreach (DataRow dr in dsTable_Order_Chitiet.Tables[0].Rows) { DataRow drnew = dsrHdbanhang_Chitiet.Tables[0].NewRow(); foreach (DataColumn dc in dsTable_Order_Chitiet.Tables[0].Columns) { try { drnew[dc.ColumnName] = dr[dc.ColumnName]; } catch (Exception ex) { continue; } } drnew["Ten_Hanghoa"] = dr["Ten_Hanghoa_Ban"]; drnew["Dongia_Ban"] = dr["Dongia"]; drnew["Thanhtien"] = dr["Thanhtien"]; drnew["Stt"] = i++; dsrHdbanhang_Chitiet.Tables[0].Rows.Add(drnew); } //add parameter values rptHdbanhang_noVAT.tbc_Ngay.Text = "" + dtNgay_Cash.Text + " * Bàn: " + txtTen_Table.Text; rptHdbanhang_noVAT.tbcSochungtu.Text = "" + Sochungtu; rptHdbanhang_noVAT.lblNhansu_Bill.Text = lookUpEdit_Nhansu_Bill.Text; rptHdbanhang_noVAT.lblNhansu_Bill.Text = lookUpEdit_Nhansu_Bill.Text; rptHdbanhang_noVAT.lblKhachhang.Text = lookUpEdit_Khachhang.Text; double thanhtien = Convert.ToDouble(dsTable_Order_Chitiet.Tables[0].Compute("sum(Thanhtien)", "")); if (txtTien_Booking.Text != "") { thanhtien -= Convert.ToDouble(txtTien_Booking.EditValue); } rptHdbanhang_noVAT.PageSize = new Size(800, 1400 + 100 * Convert.ToInt32(dsrHdbanhang_Chitiet.Tables[0].Rows.Count)); //Trừ tiền cọc booking if ("" + Tien_Booking != "") { decimal Thanhtien_TG = Convert.ToDecimal("0" + dsrHdbanhang_Chitiet.Tables[0].Rows[dsrHdbanhang_Chitiet.Tables[0].Rows.Count - 1]["Thanhtien_TG"]); Thanhtien_TG -= Convert.ToDecimal(Tien_Booking); dsrHdbanhang_Chitiet.Tables[0].Rows[dsrHdbanhang_Chitiet.Tables[0].Rows.Count - 1]["Thanhtien_TG"] = Thanhtien_TG; rptHdbanhang_noVAT.xrTable_Tien_Booking.Visible = true; rptHdbanhang_noVAT.lblTien_Booking.Text = string.Format("{0:#,#}", Tien_Booking); } else { rptHdbanhang_noVAT.xrTable6.Location = new System.Drawing.Point(21, 42); rptHdbanhang_noVAT.xrTable4.Location = new System.Drawing.Point(21, 135); //thanhtien -= Convert.ToDouble("0" + dsTable_Order_Chitiet.Tables[0].Compute("Sum(Thanhtien_Km)", "")); } #region Set he so ctrinh - logo, ten cty using (DataSet dsHeso_Chuongtrinh = objMasterService.Get_Rex_Dm_Heso_Chuongtrinh_Collection3().ToDataSet()) { DataSet dsCompany_Paras = new DataSet(); dsCompany_Paras.Tables.Add("Company_Paras"); dsCompany_Paras.Tables[0].Columns.Add("CompanyName", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyAddress", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyLogo", typeof(byte[])); byte[] imageData = Convert.FromBase64String("" + dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyLogo"))[0]["Heso"]); dsCompany_Paras.Tables[0].Rows.Add(new object[] { dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyName"))[0]["Heso"] , dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyAddress"))[0]["Heso"] , imageData }); rptHdbanhang_noVAT.xrc_CompanyName.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyName")); rptHdbanhang_noVAT.xrc_CompanyAddress.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyAddress")); rptHdbanhang_noVAT.xrPic_Logo.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Image", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyLogo")); } #endregion rptHdbanhang_noVAT.lbl_Dathutien.Visible = true; if (lookUpEdit_Khachhang.EditValue != null) // check if khách hàng quota --> hiển thị thông tin giảm giá { //ds_Khachhang = objWareService.Get_All_Ware_Khachhang_Quota_Detail_By_Khachhang(lookUpEdit_Khachhang.EditValue).ToDataSet(); //if (ds_Khachhang.Tables.Count > 0 && ds_Khachhang.Tables[0].Rows.Count > 0) //{ // if (ds_Khachhang.Tables[0].Rows[0]["Id_Vip_Member"].ToString() == "") // check if khach hang quota // { // rptHdbanhang_noVAT.lblSotien_Giam.Visible = true; // rptHdbanhang_noVAT.xrSotien_Giam.Visible = true; // thanhtien -= Convert.ToDouble("0" + dsTable_Order_Chitiet.Tables[0].Compute("Sum(Thanhtien_Km)", "")); // } //} } rptHdbanhang_noVAT.lblTongcong.Text = thanhtien.ToString(); string str = GoobizFrame.Windows.HelperClasses.ReadNumber.ChangeNum2VNStr(thanhtien, " đồng."); str = str.Substring(0, 1).ToUpper() + str.Substring(1).ToLower(); rptHdbanhang_noVAT.tbcThanhtien_Bangchu.Text = str; rptHdbanhang_noVAT.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(rptHdbanhang_noVAT); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { frmPrintPreview.Text = "" + oReportOptions.Caption; frmPrintPreview.printControl1.PrintingSystem = rptHdbanhang_noVAT.PrintingSystem; frmPrintPreview.MdiParent = this.MdiParent; frmPrintPreview.Text = this.Text + "(Xem trang in)"; frmPrintPreview.Show(); frmPrintPreview.Activate(); } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rptHdbanhang_noVAT); ReportPrintTool.Print(); } return(base.PerformPrintPreview()); }
private void Load_Rptware_Nhap_Chitiet() { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); hashtableControls.Add(lookUpEdit_Cuahang_Ban, lblCuahang_Ban.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } DataSet ds_Xuat_Chittiet = objWareService.Get_All_Ware_Nhap_Chitiet(lookUpEdit_Cuahang_Ban.EditValue, dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue, lookUpEdit_Mahang.EditValue, null).ToDataSet(); Reports.XtraReports.rptWare_Xuatnhap_Chitiet _Rptware_Xuatnhap_Chitiet = new Ecm.Reports.XtraReports.rptWare_Xuatnhap_Chitiet(); #region Thiết lập hệ số chương trình (Logo, thông tin công ty) using (DataSet dsHeso_Chuongtrinh = objMasterService.Get_Rex_Dm_Heso_Chuongtrinh_Collection3().ToDataSet()) { DataSet dsCompany_Paras = new DataSet(); dsCompany_Paras.Tables.Add("Company_Paras"); dsCompany_Paras.Tables[0].Columns.Add("CompanyName", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyAddress", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyLogo", typeof(byte[])); byte[] imageData = Convert.FromBase64String("" + dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyLogo"))[0]["Heso"]); dsCompany_Paras.Tables[0].Rows.Add(new object[] { dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyName"))[0]["Heso"] , dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyAddress"))[0]["Heso"] , imageData }); _Rptware_Xuatnhap_Chitiet.xrc_CompanyName.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyName")); _Rptware_Xuatnhap_Chitiet.xrc_CompanyAddress.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyAddress")); } #endregion _Rptware_Xuatnhap_Chitiet.xrLabel_ReportName.Text = @"SỔ CHI TIẾT NHẬP HÀNG"; _Rptware_Xuatnhap_Chitiet.xrTable_Loaiphieu.Text = @"PHIẾU NHẬP"; _Rptware_Xuatnhap_Chitiet.xrTable_Kho.Text = lookUpEdit_Cuahang_Ban.Text; _Rptware_Xuatnhap_Chitiet.xrTable_Denngay.Text = DateTime.Parse(dtNgay_Ketthuc.EditValue.ToString()).ToString("dd/MM/yyyy"); _Rptware_Xuatnhap_Chitiet.xrTable_Tungay.Text = DateTime.Parse(dtNgay_Batdau.EditValue.ToString()).ToString("dd/MM/yyyy"); _Rptware_Xuatnhap_Chitiet.xrTable_ngay.Text = DateTime.Today.Day.ToString(); _Rptware_Xuatnhap_Chitiet.xrTable_Thang.Text = DateTime.Today.Month.ToString(); _Rptware_Xuatnhap_Chitiet.xrTable_Nam.Text = DateTime.Today.Year.ToString(); _Rptware_Xuatnhap_Chitiet.DataSource = ds_Xuat_Chittiet; _Rptware_Xuatnhap_Chitiet.CreateDocument(); string path_file = @"Resources\repx\rptWare_Xuatnhap_Chitiet.repx"; if (System.IO.File.Exists(path_file)) { System.IO.File.Delete(path_file); } GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _Rptware_Xuatnhap_Chitiet; GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_Rptware_Xuatnhap_Chitiet); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _Rptware_Xuatnhap_Chitiet.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_Rptware_Xuatnhap_Chitiet); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); }
private void printSingle() { //跳到预览 //if (!string.IsNullOrEmpty(model.FAutoID)) //{ // (App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report1(this.txtAutoID.Text)); //} //else //{ // MessageBox.Show("请输入选中一条数据,或者保存"); //} string keyString = this.model.FAutoID; var model = visaORM.Customer.FirstOrDefault(c => c.FAutoID == keyString); if (model == null) { MessageBox.Show("找不到对应的签证,可能你还未保存"); return; } Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, keyString); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); }
void printMethod(string SendNo) { Report.ReportTable4 report = new Report.ReportTable4(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.printSendInfo_SP1.sp_SelectPrintSendInfo, SendNo); MainPreview.Model = new XtraReportPreviewModel(report); var model = visaORM.SendInfo.FirstOrDefault(s => s.FSendNo == SendNo); if (model != null) { report.xrLabelDSN.Text = model.FDSN; report.xrLabelComapny.Text = model.FVietnamCompany; } else { report.xrLabelDSN.Text = ""; report.xrLabelComapny.Text = ""; } report.xrLabelCaption.Text = "表格四"; DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); }
void LoadRptChitiet_Hangmua() { System.Collections.Hashtable hastTable = new System.Collections.Hashtable(); hastTable.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hastTable.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); //hastTable.Add(lookUpEdit_Doituong, lblDoituong.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hastTable)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } Reports.XtraReports.rptWare_Muahang_Chitiet rptWare_Muahang = new Ecm.Reports.XtraReports.rptWare_Muahang_Chitiet(); Datasets.DsRptWare_Hdmuahang dsHdmuahang = new Ecm.Reports.Datasets.DsRptWare_Hdmuahang(); DataSet dstemp = objWareService.Get_All_Ware_Hdmuahang_ByNhacungcap_ByDate(lookUpEdit_Doituong.EditValue, dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue).ToDataSet(); int i = 1; foreach (DataRow dtr in dstemp.Tables[0].Rows) { DataRow dtrNew = dsHdmuahang.Tables[0].NewRow(); foreach (DataColumn dtc in dstemp.Tables[0].Columns) { try { dtrNew[dtc.ColumnName] = dtr[dtc.ColumnName]; } catch (Exception ex) { } } dtrNew["Stt"] = i; i++; dsHdmuahang.Tables[0].Rows.Add(dtrNew); } setHesoChuongtrinh(rptWare_Muahang.xrc_CompanyName, rptWare_Muahang.xrc_CompanyAddress, rptWare_Muahang.xrPic_Logo); rptWare_Muahang.xrDate_From.Text = dtNgay_Batdau.Text; rptWare_Muahang.xrDate_To.Text = dtNgay_Ketthuc.Text; rptWare_Muahang.xrNgayKy.Text = DateTime.Now.Day.ToString(); rptWare_Muahang.xrThangKy.Text = DateTime.Now.Month.ToString(); rptWare_Muahang.xrNamKy.Text = DateTime.Now.Year.ToString(); rptWare_Muahang.DataSource = dsHdmuahang; GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = rptWare_Muahang; rptWare_Muahang.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(rptWare_Muahang); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = rptWare_Muahang.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rptWare_Muahang); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); }
public void Print(object Id_Winecard) { var drWinecard = objBarService.GetBar_Winecard_ById(Id_Winecard).ToDataSet().Tables[0].Rows[0]; if (string.IsNullOrWhiteSpace("" + drWinecard["Id_Nhansu_Xnhan"])) { GoobizFrame.Windows.Forms.UserMessage.Show("ACCESS_DENIED", new string[] { }); return; } Ecm.Bar.Reports.rptBar_Winecard rptBar_Winecard = new Ecm.Bar.Reports.rptBar_Winecard(); GoobizFrame.Windows.Forms.FrmPrintPreview frmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); frmPrintPreview.Report = rptBar_Winecard; #region Set he so ctrinh - logo, ten cty using (DataSet dsHeso_Chuongtrinh = objMasterService.Get_Rex_Dm_Heso_Chuongtrinh_Collection3().ToDataSet()) { DataSet dsCompany_Paras = new DataSet(); dsCompany_Paras.Tables.Add("Company_Paras"); dsCompany_Paras.Tables[0].Columns.Add("CompanyName", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyAddress", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyLogo", typeof(byte[])); byte[] imageData = Convert.FromBase64String("" + dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyLogo"))[0]["Heso"]); dsCompany_Paras.Tables[0].Rows.Add(new object[] { dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyName"))[0]["Heso"] , dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyAddress"))[0]["Heso"] , imageData }); rptBar_Winecard.xrc_CompanyName.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyName")); rptBar_Winecard.xrc_CompanyAddress.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyAddress")); rptBar_Winecard.xrPic_Logo.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Image", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyLogo")); } #endregion rptBar_Winecard.xrcSo_Chungtu.Text = "" + drWinecard["So_Chungtu"]; rptBar_Winecard.xrbcSo_Chungtu.Text = "" + drWinecard["So_Chungtu"];//barcode rptBar_Winecard.xrcNgay_Batdau.Text = "" + drWinecard["Ngay_Batdau"]; rptBar_Winecard.xrcTen_Khachhang.Text = "" + drWinecard["Ten_Khachhang"]; rptBar_Winecard.xrcDienthoai.Text = "" + drWinecard["Dienthoai"]; rptBar_Winecard.xrcTen_Hanghoa_Ban.Text = "" + drWinecard["Ten_Hanghoa_Ban"]; rptBar_Winecard.xrcGhichu.Text = "" + drWinecard["Ghichu"]; rptBar_Winecard.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(rptBar_Winecard); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { frmPrintPreview.Text = "" + oReportOptions.Caption; frmPrintPreview.printControl1.PrintingSystem = rptBar_Winecard.PrintingSystem; frmPrintPreview.MdiParent = this.MdiParent; frmPrintPreview.Text = this.Text + "(Xem trang in)"; frmPrintPreview.Show(); frmPrintPreview.Activate(); } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rptBar_Winecard); ReportPrintTool.Print(); } }
public override bool PerformPrintPreview() { try { DataSets.DsWare_Dm_Khachhang _DsWare_Dm_Khachhang = new DataSets.DsWare_Dm_Khachhang(); Reports.rptWare_Dm_Khachhang _rptWare_Dm_Khachhang = new Reports.rptWare_Dm_Khachhang(); GoobizFrame.Windows.Forms.FrmPrintPreview frmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); frmPrintPreview.Report = _rptWare_Dm_Khachhang; //frmPrintPreview.Name = this.Name; //frmPrintPreview.EnablePrintPreview = this.EnablePrintPreview; _rptWare_Dm_Khachhang.DataSource = _DsWare_Dm_Khachhang; foreach (DataRow dr in ds_Collection.Tables[0].Select("Chon = True", "")) { DataRow drnew = _DsWare_Dm_Khachhang.Tables[0].NewRow(); foreach (DataColumn dc in ds_Collection.Tables[0].Columns) { try { drnew[dc.ColumnName] = dr[dc.ColumnName]; } catch { continue; } } _DsWare_Dm_Khachhang.Tables[0].Rows.Add(drnew); } //add parameter values #region Set he so ctrinh - logo, ten cty using (DataSet dsCompany_Paras = new DataSet()) { dsCompany_Paras.Tables.Add("Company_Paras"); dsCompany_Paras.Tables[0].Columns.Add("CompanyName", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyAddress", typeof(string)); dsCompany_Paras.Tables[0].Columns.Add("CompanyLogo", typeof(byte[])); DataSet dsHeso_Chuongtrinh = objMasterService.Get_Rex_Dm_Heso_Chuongtrinh_Collection3().ToDataSet(); byte[] imageData = Convert.FromBase64String("" + dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyLogo"))[0]["Heso"]); dsCompany_Paras.Tables[0].Rows.Add(new object[] { dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyName"))[0]["Heso"] , dsHeso_Chuongtrinh.Tables[0].Select(string.Format("Ma_Heso_Chuongtrinh='{0}'", "CompanyAddress"))[0]["Heso"] , imageData }); _rptWare_Dm_Khachhang.xrc_CompanyName.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyName")); _rptWare_Dm_Khachhang.xrc_CompanyAddress.DataBindings.Add( new DevExpress.XtraReports.UI.XRBinding("Text", dsCompany_Paras, dsCompany_Paras.Tables[0].TableName + ".CompanyAddress")); } #endregion _rptWare_Dm_Khachhang.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Dm_Khachhang); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { frmPrintPreview.Text = "" + oReportOptions.Caption; frmPrintPreview.printControl1.PrintingSystem = _rptWare_Dm_Khachhang.PrintingSystem; frmPrintPreview.MdiParent = this.MdiParent; frmPrintPreview.Text = this.Text + "(Xem trang in)"; frmPrintPreview.Show(); frmPrintPreview.Activate(); } else { var reportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Dm_Khachhang); reportPrintTool.Print(); } } catch (Exception ex) { ex.ToString(); return(false); } return(base.PerformPrintPreview()); }
void printVisa() { try { if (cbSubmitList.SelectedItem == null) { MessageBox.Show("请先选择已提交名单"); return; } string submitNo = cbSubmitList.SelectedItem.ToString(); string keyString = ""; var visaModelArray = visaORM.TB_TableSubmit.Where(s => s.FSubmitNo == submitNo); //List<string> ids = new List<string>(); foreach (var visaModel in visaModelArray) { keyString += visaModel.FAutoID + ","; //ids.Add(visaModel.FAutoID); } //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report1(ids)); Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, keyString); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report2(MainContext.UserCompanyName, newSubmitNo)); } catch (System.Exception ex) { MessageBox.Show(ex.Message); Log.WriteLog.WriteErorrLog(ex); } }
private void txtPrintSingle_KeyUp(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, this.txtPrintSingle.Text); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report1(this.txtPrintSingle.Text)); } }
private void PrintReportDocument(string location, string jobName, byte typeId, long documentId) { DB.RPT_Report rptReport = null; switch (typeId) { case (byte)BL.SYS.SYS_DOC_Type.Quote: case (byte)BL.SYS.SYS_DOC_Type.CreditNote: case (byte)BL.SYS.SYS_DOC_Type.BackOrder: case (byte)BL.SYS.SYS_DOC_Type.SalesOrder: case (byte)BL.SYS.SYS_DOC_Type.TAXInvoice: rptReport = BL.RPT.RPT_Report.LoadByName("Sales Document Template", DataContext); break; case (byte)BL.SYS.SYS_DOC_Type.PickingSlip: rptReport = BL.RPT.RPT_Report.LoadByName("Picking Slip Document Template", DataContext); break; case (byte)BL.SYS.SYS_DOC_Type.PurchaseOrder: case (byte)BL.SYS.SYS_DOC_Type.GoodsReceived: case (byte)BL.SYS.SYS_DOC_Type.GoodsReturned: rptReport = BL.RPT.RPT_Report.LoadByName("Purchase Document Template", DataContext); break; case (byte)BL.SYS.SYS_DOC_Type.TransferRequest: case (byte)BL.SYS.SYS_DOC_Type.TransferShipment: case (byte)BL.SYS.SYS_DOC_Type.TransferReceived: rptReport = BL.RPT.RPT_Report.LoadByName("Transfer Document Template", DataContext); break; case (byte)BL.SYS.SYS_DOC_Type.InventoryAdjustment: rptReport = BL.RPT.RPT_Report.LoadByName("Stock Document Template", DataContext); break; case (byte)BL.SYS.SYS_DOC_Type.Job: rptReport = BL.RPT.RPT_Report.LoadByName("Work Document Template", DataContext); break; case (byte)BL.SYS.SYS_DOC_Type.BOMAssemblyStarted: case (byte)BL.SYS.SYS_DOC_Type.BOMDisassemblyStarted: case (byte)BL.SYS.SYS_DOC_Type.BOMCanceled: case (byte)BL.SYS.SYS_DOC_Type.BOMComplete: rptReport = BL.RPT.RPT_Report.LoadByName("Work Document Template", DataContext); break; } System.IO.Stream xmlstream = new System.IO.MemoryStream(System.Text.Encoding.UTF8.GetBytes(rptReport.Data)); DevExpress.XtraReports.UI.XtraReport report = new DevExpress.XtraReports.UI.XtraReport(); report.LoadLayoutFromXml(xmlstream); foreach (object oObject in report.ObjectStorage) { if (oObject is DevExpress.XtraReports.Parameters.LookUpSettings) { object dataSource = (oObject as DevExpress.XtraReports.Parameters.LookUpSettings).DataSource; if (dataSource is DevExpress.DataAccess.Sql.SqlDataSource) { ((DevExpress.DataAccess.Sql.SqlDataSource)(dataSource)).Connection.ConnectionString = BL.ApplicationDataContext.Instance.SqlConnectionString.ConnectionString; } else if (dataSource is DevExpress.DataAccess.EntityFramework.EFDataSource) { ((DevExpress.DataAccess.EntityFramework.EFDataSource)(dataSource)).Connection.ConnectionString = BL.ApplicationDataContext.Instance.EntityViewConnectionString.ConnectionString; } else { throw new Exception("Data Source type not implemented in reports"); } } } foreach (object oObject in report.ComponentStorage) { if (oObject is DevExpress.DataAccess.Sql.SqlDataSource) { ((DevExpress.DataAccess.Sql.SqlDataSource)(oObject)).Connection.ConnectionString = BL.ApplicationDataContext.Instance.SqlConnectionString.ConnectionString; } else if (oObject is DevExpress.DataAccess.EntityFramework.EFDataSource) { ((DevExpress.DataAccess.EntityFramework.EFDataSource)(oObject)).Connection.ConnectionString = BL.ApplicationDataContext.Instance.EntityViewConnectionString.ConnectionString; } else { throw new Exception("Data Source type not implemented in reports"); } } if (report.Parameters.Count != 0) { foreach (var extparam in report.Parameters) { if (extparam.Name == "DocumentId") { extparam.Value = documentId; } } } try { report.CreateDocument(false); report.PrintingSystem.Document.Name = jobName; using (DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(report)) { // Send the report to the specified printer. printTool.Print(location); } } catch (Exception ex) { DataContext.EntityOrganisationContext.RejectChanges(); if (CDS.Shared.Exception.UserInterfaceExceptionHandler.HandleException(ref ex)) { throw ex; } } }
private void Load_rptWare_Congno_Chitiet() { try { System.Collections.Hashtable hashtableControls = new System.Collections.Hashtable(); hashtableControls.Add(dtNgay_Batdau, lblNgay_Batdau.Text); hashtableControls.Add(dtNgay_Ketthuc, lblNgay_Ketthuc.Text); hashtableControls.Add(lookUpEditMa_Ncc, lblDoituong.Text); if (!GoobizFrame.Windows.MdiUtils.Validator.CheckNullFields(hashtableControls)) { return; } if (!GoobizFrame.Windows.MdiUtils.Validator.CheckDate(dtNgay_Batdau, dtNgay_Ketthuc)) { return; } DataSet ds_Congnothu = objReportService.RptCongno_NCC_Chitiet(dtNgay_Batdau.EditValue, dtNgay_Ketthuc.EditValue, lookUpEditTen_Ncc.EditValue).ToDataSet(); Ecm.Reports.XtraReports.rptWare_Congno_Chitiet _rptWare_Congno_Chitiet = new Ecm.Reports.XtraReports.rptWare_Congno_Chitiet(); _rptWare_Congno_Chitiet.DataSource = ds_Congnothu; GoobizFrame.Windows.Forms.FrmPrintPreview _FrmPrintPreview = new GoobizFrame.Windows.Forms.FrmPrintPreview(); _FrmPrintPreview.Report = _rptWare_Congno_Chitiet; // Thiết lập hệ số chương trình (Logo, thông tin công ty) setHesoChuongtrinh(_rptWare_Congno_Chitiet.xrc_CompanyName, _rptWare_Congno_Chitiet.xrc_CompanyAddress, null); _rptWare_Congno_Chitiet.xrDate_From.Text = dtNgay_Batdau.DateTime.ToString("dd/MM/yyyy"); _rptWare_Congno_Chitiet.xrDate_To.Text = dtNgay_Ketthuc.DateTime.ToString("dd/MM/yyyy"); _rptWare_Congno_Chitiet.xrTableCell_TenKH.Text = lookUpEditTen_Ncc.Text + " - " + lookUpEditMa_Ncc.Text; _rptWare_Congno_Chitiet.xrTableCell_Dienthoai.Text = lookUpEditMa_Ncc.GetColumnValue("Dienthoai").ToString(); _rptWare_Congno_Chitiet.xrTableCell_Diachi.Text = lookUpEditMa_Ncc.GetColumnValue("Diachi_Nhacungcap").ToString(); _rptWare_Congno_Chitiet.xrTableCell_KH.Text = "Tên NCC"; _rptWare_Congno_Chitiet.xrTable_Ngay.Text = DateTime.Today.Day.ToString(); _rptWare_Congno_Chitiet.xrTable_Thang.Text = DateTime.Today.Month.ToString(); _rptWare_Congno_Chitiet.xrTable_Nam.Text = DateTime.Today.Year.ToString(); _rptWare_Congno_Chitiet.CreateDocument(); GoobizFrame.Windows.Forms.ReportOptions oReportOptions = GoobizFrame.Windows.Forms.ReportOptions.GetReportOptions(_rptWare_Congno_Chitiet); if (Convert.ToBoolean(oReportOptions.PrintPreview)) { _FrmPrintPreview.Text = "" + oReportOptions.Caption; _FrmPrintPreview.printControl1.PrintingSystem = _rptWare_Congno_Chitiet.PrintingSystem; _FrmPrintPreview.MdiParent = this.MdiParent; _FrmPrintPreview.Text = this.Text + "(Xem trang in)"; _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } else { var ReportPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(_rptWare_Congno_Chitiet); ReportPrintTool.Print(); } _FrmPrintPreview.Show(); _FrmPrintPreview.Activate(); } catch (Exception ex) { #if DEBUG MessageBox.Show(ex.Message); #endif } }
/// <summary> /// Ejecuta el metodo Grabar. /// </summary> /// <returns>El valor que se obtiene despues de ejecutar el metodo</returns> override public bool Grabar() { bool resultado = false; List <SqlParameter> parametros = new List <SqlParameter>(); SqlParameter paramId = new SqlParameter(); paramId.ParameterName = "@P_Id_Venta"; paramId.Value = Id_Venta; paramId.Direction = System.Data.ParameterDirection.InputOutput; parametros.Add(paramId); parametros.Add(new SqlParameter() { ParameterName = "@P_IdCliente", Value = Id_Cliente }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdSucursal", Value = Id_Sucursal }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdEmpleado", Value = Id_Empleado }); parametros.Add(new SqlParameter() { ParameterName = "@P_FechaVenta", Value = Fecha_Venta }); parametros.Add(new SqlParameter() { ParameterName = "@P_HoraVenta", Value = Hora_Venta }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdCotizacion", Value = Id_Cotizacion }); parametros.Add(new SqlParameter() { ParameterName = "@P_Subtotal", Value = Subtotal }); parametros.Add(new SqlParameter() { ParameterName = "@P_IVA", Value = IVA }); parametros.Add(new SqlParameter() { ParameterName = "@P_IEPS", Value = IEPS }); parametros.Add(new SqlParameter() { ParameterName = "@P_Total", Value = Total }); parametros.Add(new SqlParameter() { ParameterName = "@P_FechaTipoCambio", Value = Fecha_Tipo_Cambio }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdTipoCambio", Value = Id_Tipo_Cambio }); parametros.Add(new SqlParameter() { ParameterName = "@P_Comentario", Value = Comentario }); parametros.Add(new SqlParameter() { ParameterName = "@P_Status", Value = Status }); parametros.Add(new SqlParameter() { ParameterName = "@P_Descuento", Value = Descuento }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdFactura", Value = Id_Factura }); parametros.Add(new SqlParameter() { ParameterName = "@P_MetodoPago", Value = Id_Metodo_pago }); parametros.Add(new SqlParameter() { ParameterName = "@P_Referencia", Value = Referencia }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdTipoPago", Value = Id_Tipo_Venta }); parametros.Add(new SqlParameter() { ParameterName = "@P_SuPago", Value = Su_Pago }); parametros.Add(new SqlParameter() { ParameterName = "@P_SuCambio", Value = Su_Cambio }); parametros.Add(new SqlParameter() { ParameterName = "@P_Debe", Value = Debe }); parametros.Add(new SqlParameter() { ParameterName = "@P_IdPromocion", Value = Id_Promocion }); parametros.Add(new SqlParameter() { ParameterName = "@P_IVAimporte", Value = IVAimporte }); parametros.Add(new SqlParameter() { ParameterName = "@P_IEPSimporte", Value = IEPSimporte }); parametros.Add(new SqlParameter() { ParameterName = "@P_DescuentoPorCiento", Value = ISR_PorCiento }); parametros.Add(new SqlParameter() { ParameterName = "@P_Tipo", Value = Convert.ToInt32(TIPO) }); resultado = (BaseDatos.ejecutarProcedimiento(QueryGrabar, parametros) > 0); if (resultado && Id_Venta == -1) { Id_Venta = Convert.ToInt64(paramId.Value); } string empleado = string.Empty; foreach (VentaDetalle detalle in Detalles) { detalle.Id_Venta = Id_Venta; if (empleado.Length == 0) { empleado = detalle.Quien_Surte; } } if (resultado) { if (GrabarDetalle()) { if (!demostracion) { XtraImprimeTicket ticket = new XtraImprimeTicket(this); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(ticket); try { pt.PrintingSystem.StartPrint += new PrintDocumentEventHandler(printingSystem_StartPrint); pt.Print(); } catch (Exception ex) { Log.Logger.ErrorException(ex.Message, ex); } } } if (TIPO == TIPO_MOVIMIENTO.VENTA) { ClientesCargos clientecargo = new ClientesCargos(); clientecargo.Tipo_Cargo = Id_Tipo_Venta; clientecargo.Fecha = Fecha_Venta; clientecargo.IdVenta = Id_Venta; clientecargo.IdCliente = Id_Cliente; clientecargo.Concepto = Comentario.Replace("Venta ", "Venta Folio No." + Id_Venta + " "); if (((TIPO_VENTA)Id_Tipo_Venta) == TIPO_VENTA.CONTADO) { clientecargo.Cargos = Convert.ToDouble(Total); clientecargo.Abonos = Convert.ToDouble(Total); clientecargo.Saldo = 0; } else { clientecargo.Cargos = Convert.ToDouble(Total); clientecargo.Abonos = Convert.ToDouble(Su_Pago); clientecargo.Saldo = Convert.ToDouble(Debe); } clientecargo.Estado = Status; clientecargo.Activo = true; clientecargo.Grabar(); if (((TIPO_VENTA)Id_Tipo_Venta) == TIPO_VENTA.CREDITO) { parametros.Clear(); parametros.Add(new SqlParameter() { ParameterName = "@P_Cliente_Id", Value = Id_Cliente }); parametros.Add(new SqlParameter() { ParameterName = "@P_Cantidad", Value = Debe }); resultado = (BaseDatos.ejecutarProcedimiento("Clientes_Saldo_Aumentar_sp", parametros) > 0); } } } return(resultado); }
private void printAll() { //(App.Current.Windows[1] as MainWindow).MainFrame.Navigate(new Report1(printID)); string keyString = ""; foreach (var obj in customerList) { keyString += obj.FAutoID + ","; } Report.ReportTable1 report = new Report.ReportTable1(); report.sp_SelectPrintSendInfoTableAdapter.Fill(report.sp_SelectTable1ForPrint1._sp_SelectTable1ForPrint, keyString); DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(report); pt.Print(); }