void DoPrint(int invoiceID) { decimal cashFromCustomer = Convert.ToDecimal(txtCashFromCustomer.EditValue); decimal CashReturn = Convert.ToDecimal(txtCashReturn.EditValue); Reports.SaleRpt rpt = new SaleRpt(Convert.ToDecimal(txtDiscount.EditValue), Convert.ToDecimal(txtAfterDiscount.EditValue), cashFromCustomer, CashReturn, invoiceID.ToString(), UserData.Default.UserName); ////var list = from s in db.vw_Sale2 where s.SaleInvoiceID == invoiceID select s; ////rpt.DataSource = list.ToList(); rpt.DataSource = rptList.ToList(); ////txtAfterDiscount.EditValue = 0; ////txtInvoiceTotal.EditValue = 0; ////txtDiscount.EditValue = 0; try { ReportPrintTool tool = new ReportPrintTool(rpt); // string InvoicePrinter = System.Configuration.ConfigurationManager.AppSettings["InvoicePrinter"]; if (InvoicePrinter == "") { tool.Print(); } else { tool.Print(InvoicePrinter); } } catch (Exception ex) { ModuleClass.ShowExceptionMessage(this, ex, "خطأ", null); } }
private bool PrintDetails(DataAccess.PurchaseInvoiceDetail detail, Int16 noOfCopies) { bool result = true; var item = db.Items.Where(s => s.ID == detail.ItemID).SingleOrDefault(); DataAccess.ItemBarcode ibc = db.ItemBarcodes.Where(s => s.SystemBarcode == true && s.ItemID == item.ID).SingleOrDefault(); string BarcodeText = ibc.BarcodeText; // item.BarcodeText; ZebraBarcodeLabelRPT rpt = new ZebraBarcodeLabelRPT(BarcodeText, item.Name, item.SalePrice.ToString(), cbPrintPrice.Checked); // detail.SalePrice.ToString()); // rpt.DataSource = list; ReportPrintTool tool = new ReportPrintTool(rpt); rpt.PrintingSystem.StartPrint += new DevExpress.XtraPrinting.PrintDocumentEventHandler(PrintingSystem_StartPrint); NoOfCopies = noOfCopies; // detail.Quantity; string BarcodePrinter = this.BarcodePrinter; // System.Configuration.ConfigurationManager.AppSettings["BarcodePrinter"]; if (BarcodePrinter == "") { tool.Print(); } else { tool.Print(BarcodePrinter); } return(result); }
public void GetReport(XtraReport report, string Impressora, int Copias) { if (report == null) { report = new XtraReport(); } report.ShowPrintMarginsWarning = false; xtraReport = report; report.CreateDocument(); reportPrintTool = new ReportPrintTool(xtraReport); xtraReport.ShowPrintMarginsWarning = false; if (Impressora != "") { while (Copias != 0) { //ReportPrintTool.MA reportPrintTool.Print(Impressora); Copias--; } } else { MessageBox.Show("Lamentamos Mais tens que configurar a Impressora Antes de Começares a Fazer Vendas!...\nMais neste caso vamos imprimir na impressora definida como Padrão"); while (Copias != 0) { //ReportPrintTool.MA reportPrintTool.Print(); Copias--; } } }
private void button3_Click(object sender, EventArgs e) { rp_hedefte_yazdir s = new rp_hedefte_yazdir(tb_urun_adi.Text, tb_barkod.Text); ReportPrintTool printTool = new ReportPrintTool(s); try { printTool.Print(text); } catch { printTool.Print(); } //printTool.ShowPreviewDialog(); }
private void simpleButton13_Click(object sender, EventArgs e) { rp_adisyon_satis_raporu s1 = new rp_adisyon_satis_raporu(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s1.CreateDocument(); rp_masa_grubuna_gore_satislar s2 = new rp_masa_grubuna_gore_satislar(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s2.CreateDocument(); rp_masalara_gore_satislar s3 = new rp_masalara_gore_satislar(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s3.CreateDocument(); rp_personel_satis s4 = new rp_personel_satis(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s4.CreateDocument(); rp_urun_satislari s5 = new rp_urun_satislari(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s5.CreateDocument(); rp_urun_kategori_satis s6 = new rp_urun_kategori_satis(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s6.CreateDocument(); rp_ust_kategori_satis s7 = new rp_ust_kategori_satis(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s7.CreateDocument(); rp_personel_ikram s8 = new rp_personel_ikram(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s8.CreateDocument(); rp_personel_iptal s9 = new rp_personel_iptal(uc_tarih_sec2.ilk_tarih, uc_tarih_sec2.son_tarih); s9.CreateDocument(); ReportPrintTool printTool1 = new ReportPrintTool(s1); try { printTool1.Print(text); } catch { printTool1.Print(); } ReportPrintTool printTool2 = new ReportPrintTool(s2); try { printTool2.Print(text); } catch { printTool2.Print(); } ReportPrintTool printTool3 = new ReportPrintTool(s3); try { printTool3.Print(text); } catch { printTool3.Print(); } ReportPrintTool printTool4 = new ReportPrintTool(s4); try { printTool4.Print(text); } catch { printTool4.Print(); } ReportPrintTool printTool5 = new ReportPrintTool(s5); try { printTool5.Print(text); } catch { printTool5.Print(); } ReportPrintTool printTool6 = new ReportPrintTool(s6); try { printTool6.Print(text); } catch { printTool6.Print(); } ReportPrintTool printTool7 = new ReportPrintTool(s7); try { printTool7.Print(text); } catch { printTool7.Print(); } ReportPrintTool printTool8 = new ReportPrintTool(s8); try { printTool8.Print(text); } catch { printTool8.Print(); } ReportPrintTool printTool9 = new ReportPrintTool(s9); try { printTool9.Print(text); } catch { printTool9.Print(); } }
private void button1_Click(object sender, EventArgs e) { // Create a report instance, assigned to a Print Tool. ReportPrintTool pt = new ReportPrintTool(new XtraReport1()); // Invoke the Print dialog. pt.PrintDialog(); // Send the report to the default printer. pt.Print(); // Send the report to the specified printer. pt.Print("myPrinter"); }
public static void PrintData(string reportName, List <T> printList = null) { ReportPrintTool rptPrint = null; switch (reportName.ToUpper()) { case "SHIPPINGMARK": rptShippingMark rpt = new rptShippingMark(); rpt.LoadDataToReport(printList as List <ShippingMark>); rptPrint = new ReportPrintTool(rpt); break; case "SHIPPINGTO": rptShippingTo rptTo = new rptShippingTo(); rptTo.LoadData(printList as List <ShippingTo>); rptPrint = new ReportPrintTool(rptTo); break; case "BOXNOTINPALLETE": rptBoxNotInPallete rptBoxFound = new rptBoxNotInPallete(); rptBoxFound.LoadData(printList as List <BoxNotExist>); rptPrint = new ReportPrintTool(rptBoxFound); break; case "PCLORING": // M300OR1: In phieu PCL rptPrintPclOring prtPrintPclOR = new rptPrintPclOring(); prtPrintPclOR.LoadData(printList as List <PclOring>); rptPrint = new ReportPrintTool(prtPrintPclOR); break; case "BOXNOTINPALLETEANDTITLE": rptBoxNotInPallete rptBoxFoundWithtitle = new rptBoxNotInPallete(); rptBoxFoundWithtitle.LoadDataAndTitle(printList as List <BoxNotExist>); rptPrint = new ReportPrintTool(rptBoxFoundWithtitle); break; } //rptPrint.PrintingSystem.StartPrint += PrintingSystem_StartPrint; //rptPrint.ShowPreviewDialog(); if (string.IsNullOrEmpty(Properties.Settings.Default.PRINTER_NAME)) { rptPrint.Print(); } else { rptPrint.Print(Properties.Settings.Default.PRINTER_NAME); } }
private void IrAPaginaTicket() { navFrameMenuInicial.SelectedPage = navPageTicket; rpt = new rptTicket(); rpt.CargarDatos(Pro_Ticket_Generado, Pro_Conexion); rpt.pic_Logo.Image = Image.FromFile(ConfigurationSettings.AppSettings["RUTA_LOGO_INSTITUCION"]); rpt.lblNombreAgencia.Text = Pro_NombreAgenciaServicio; try { splashScreenManager1.ShowWaitForm(); rpt.CreateDocument(); documentViewer1.DocumentSource = rpt; splashScreenManager1.CloseWaitForm(); tmrTiempoVisualizacionTicket.Start(); ReportPrintTool v_print_tool = new ReportPrintTool(rpt); v_print_tool.Print(ConfigurationSettings.AppSettings["IMPRESORA_TICKETS"]); } catch (Exception Exc) { MessageBox.Show(Exc.Message, "FLUCOL"); } }
/// <summary> /// 打印 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void button2_Click(object sender, EventArgs e) { if (_currentPrintSet == null) { Speecher("Print Config is null"); return; } if (_currentGoodSetList == null) { Speecher("Good Config is null"); return; } if (_currentRoSet == null) { Speecher("Ro# Config is null"); return; } #region 自动打印成品标签 FinishedProductLabelDTO dto = GetFinishedProductLabelDTO(); List <FinishedProductLabelDTO> dtoList = new List <FinishedProductLabelDTO>(); dtoList.Add(dto); XtraReport1 label = new XtraReport1(); label.DataSource = dtoList; label.PrintingSystem.ShowMarginsWarning = false; label.PrintingSystem.ShowPrintStatusDialog = false; label.PrintingSystem.EndPrint += PrintingSystem_EndPrint; label.PaperName = DateTime.Now.ToString() + dto.ID; ReportPrintTool tool = new ReportPrintTool(label); tool.Print(); #endregion }
public static void PrintReprt(String SRNO) { SqlConnection con = new SqlConnection(Properties.Settings.Default.strCon); if (con.State != System.Data.ConnectionState.Open) { con.Open(); } string sqlString = "Select * from DuplicatePrinting" + " where SRNO ='" + SRNO + "'"; SqlCommand cmd = new SqlCommand(sqlString, con); SqlDataAdapter adp = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); adp.Fill(ds, "DuplicatePrinting"); LabelPrintReport rpt = new LabelPrintReport(); rpt.DataSource = ds.Tables["DuplicatePrinting"]; using (ReportPrintTool printTool = new ReportPrintTool(rpt)) { printTool.Print(Properties.Settings.Default.PrinterName); // printTool.ShowPreview(); // printTool.Print("SATO CG408 (Copy 1)"); //or printTool.PrintDialog(); } if (con.State == System.Data.ConnectionState.Open) { cmd.Dispose(); con.Close(); con.Dispose(); } }
bool PrintKitchen(string State, SaleFoodOnline salefood) { try { rptkithchen.DataSource = salefood; rptkithchen.StateFact.Value = State; if (settingServer != null) { rptkithchen.xrLogo.Image = byteArrayToImage(settingServer.Img); } rptkithchen.RequestParameters = false; rptkithchen.PrintingSystem.ShowMarginsWarning = true; var rp = new ReportPrintTool(rptkithchen); rp.PrinterSettings.Copies = 1; rp.PrinterSettings.PrinterName = _SettingPrinter.PrinterAshpazkhane; rp.Print(); //rptkithchen.CreateDocument(); //SaleOnline.Rerport.frmPrview frm = new Rerport.frmPrview(); //frm.documentViewer1.DocumentSource = rptkithchen; //frm.Show(); return(true); } catch (Exception ex) { return(false); } }
bool PrintCustomreFish(string State, SaleFoodOnline salefood) { try { rptcustomer.DataSource = salefood; rptcustomer.StateFact.Value = State; rptcustomer.StringPrice.Value = JntNum2Text.Num2Text.ToFarsi(salefood.SumNetPrice.Value); if (settingServer != null) { rptcustomer.xrLogo.Image = byteArrayToImage(settingServer.Img); rptcustomer.Address.Value = settingServer.Address; rptcustomer.Tell.Value = settingServer.Tell; rptcustomer.motto.Value = settingServer.Motto; } rptcustomer.RequestParameters = false; rptcustomer.PrintingSystem.ShowMarginsWarning = true; var rp = new ReportPrintTool(rptcustomer); rp.PrinterSettings.Copies = 1; rp.PrinterSettings.PrinterName = _SettingPrinter.PrinterCustomer; rp.Print(); //rptcustomer.CreateDocument(); //SaleOnline.Rerport.frmPrview frm = new Rerport.frmPrview(); //frm.documentViewer1.DocumentSource = rptcustomer; //frm.Show(); return(true); } catch (Exception ex) { return(false); } }
private void button1_Click(object sender, EventArgs e) { XtraReport1 report1 = new XtraReport1(); XtraReport[] reports = new XtraReport[] { new XtraReport2(), new XtraReport3() }; ReportPrintTool pt1 = new ReportPrintTool(report1); pt1.PrintingSystem.StartPrint += new PrintDocumentEventHandler(PrintingSystem_StartPrint); foreach (XtraReport report in reports) { ReportPrintTool pts = new ReportPrintTool(report); pts.PrintingSystem.StartPrint += new PrintDocumentEventHandler(reportsStartPrintEventHandler); } if (pt1.PrintDialog() == true) { foreach (XtraReport report in reports) { ReportPrintTool pts = new ReportPrintTool(report); pts.Print(); } } }
public void Print() { using (ReportPrintTool printTool = new ReportPrintTool(DocumentSource as XtraReport)) { printTool.Print(); } }
private void settingsControl_PrintClick(object sender, EventArgs e) { using (var tool = new ReportPrintTool(report)) { tool.Print(printSettingsControl.SelectedPrinterName); } }
private void button1_Click(object sender, EventArgs e) { ReportPrintTool pt = new ReportPrintTool(new XtraReport1()); pt.PrintingSystem.StartPrint += new PrintDocumentEventHandler(printingSystem_StartPrint); pt.Print(); }
private void print_Click(object sender, EventArgs e) { Report report = new Report(); ReportPrintTool tl = new ReportPrintTool(report); //打印 tl.Print(); }
private void button2_Click(object sender, EventArgs e) { // 创建报表 XtraReport3 report = new XtraReport3(); // 打印 ReportPrintTool tool = new ReportPrintTool(report); tool.Print(); }
private void button2_Click(object sender, EventArgs e) { if (gv_fatura.SelectedRowsCount <= 0) { return; } /*rp_fatura s = new rp_fatura(Convert.ToInt32(gv_fatura.GetDataRow(gv_fatura.GetSelectedRows()[0])["fatura_id"].ToString())); * s.CreateDocument(); * disa_aktar d = new disa_aktar(); * d.rp_viewer.DocumentSource = s; * d.ShowDialog();*/ rp_fatura s = new rp_fatura(Convert.ToInt32(gv_fatura.GetDataRow(gv_fatura.GetSelectedRows()[0])["fatura_id"].ToString())); ReportPrintTool printTool = new ReportPrintTool(s); try { printTool.Print(text); } catch (Exception ect) { printTool.Print(); } }
private void btnPrint_Click(object sender, EventArgs e) { using (ReportPrintTool printTool = new ReportPrintTool(rpt)) { printTool.Print(); //or printTool.PrintDialog(); btnClose.PerformClick(); } }
public void GotoNextTextBox(TextBox box) { int index = 0; SN currentSN = _currentPrintSet.SNList.FirstOrDefault(p => p.Name.Trim().ToUpper() .Equals(box.Name.Trim().ToUpper())); if (currentSN != null && !string.IsNullOrWhiteSpace(currentSN.Code)) { Regex regex = new Regex(currentSN.Code); if (!regex.IsMatch(box.Text)) { if (_snList.Exists(k => k.Key.Trim().ToUpper().Equals(box.Name.Trim().ToUpper()))) { KeyValuePair <string, string> sn = _snList.FirstOrDefault(k => k.Key.Trim().ToUpper().Equals(box.Name.Trim().ToUpper())); _snList.Remove(sn); } Speecher("Scan SN Label failed"); box.Text = ""; return; } } index = currentSN == null ? 0 : currentSN.Order; bool isNext = index == 0 ? true : false; box.ReadOnly = true; foreach (var sn in _currentPrintSet.SNList) { if (isNext) { Control[] controlAry = box.Parent.Controls.Find(sn.Name, true); if (controlAry.Length == 0) { Speecher("S N Config is wrong"); return; } var nextBox = controlAry[0] as TextBox; nextBox.ReadOnly = false; nextBox.Focus(); return; } isNext = sn.Order == index; } #region 自动打印成品标签 FinishedProductLabelDTO dto = GetFinishedProductLabelDTO(); List <FinishedProductLabelDTO> dtoList = new List <FinishedProductLabelDTO>(); dtoList.Add(dto); XtraReport1 label = new XtraReport1(); label.DataSource = dtoList; label.PrintingSystem.ShowMarginsWarning = false; label.PrintingSystem.ShowPrintStatusDialog = false; label.PrintingSystem.EndPrint += PrintingSystem_EndPrint; label.PaperName = DateTime.Now.ToString() + dto.ID; ReportPrintTool tool = new ReportPrintTool(label); tool.Print(); labelID.Focus(); #endregion }
public void Yazdir(int ReportID, object data) { var rapor = RaporTasarimGetir(DesignID: ReportID); rapor.DataSource = data; var rpt = new ReportPrintTool(rapor); rpt.Print(); }
public static void GetReport(XtraReport report, bool inprimirDirecto = false, string Impressora = "", int Copy = 1) { if (report == null) { report = new XtraReport(); } report.ShowPrintMarginsWarning = false; xtraReport = report; report.CreateDocument(); ReportPrintTool = new ReportPrintTool(xtraReport); xtraReport.ShowPrintMarginsWarning = false; ReportPrintTool.PreviewForm.FormClosing += PreviewForm_FormClosing; if (!inprimirDirecto) { ReportPrintTool.ShowPreview(); } else { if (string.IsNullOrWhiteSpace(Impressora)) { MessageBox.Show("Lamentamos Mais tens que configurar a Impressora Antes de Começares a Fazer Vendas!...\n" + "Mais neste caso vamos imprimir na impressora definida como Padrão", "Configuração Requerida", MessageBoxButtons.OK, MessageBoxIcon.Warning); ReportPrintTool.ShowPreview(); } else { if (Copy != 1) { while (Copy != 1) { ReportPrintTool.Print(); Copy--; } } else { ReportPrintTool.Print(Impressora); } } } }
public void Print() { AddReportTitleForNight(); _MainReport.CreateDocument(); using (ReportPrintTool printTool = new ReportPrintTool(_MainReport)) { printTool.Print(); } }
private void simpleButton1_Click(object sender, EventArgs e) { if (currentReport == null) { return; } try { ReportPrintTool printTool = new ReportPrintTool(currentReport); // Invoke the Print dialog. printTool.PrintDialog(); // Send the report to the default printer. printTool.Print(); // Send the report to the specified printer. printTool.Print("myPrinter"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void ReportViewer_Load(object sender, EventArgs e) { try { DeliveryPermissionReport DeliveryPermissionReport = new DeliveryPermissionReport(listOfData, customerName, clientName, customerPhone, delegateName, date, BranchBillNumber, PerNum, branchId, branchName, storeKeeper, customerdelivery, customerdeliveryPhone, store_Name, flag, customerAddress); documentViewer1.DocumentSource = DeliveryPermissionReport; XtraReport1 report = new XtraReport1(); ReportPrintTool printTool = new ReportPrintTool(DeliveryPermissionReport); // Invoke the Print dialog. printTool.PrintDialog(); // Send the report to the default printer. printTool.Print(); // Send the report to the specified printer. printTool.Print("myPrinter"); // DeliveryPermissionReport.CreateDocument(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
/// <summary> /// 非同步列印 但只能印XtraReport的元件 /// </summary> public void Print(XtraReport report) { AddReportTitleForNight(); report.CreateDocument(); var storage = new DevExpress.XtraPrinting.Caching.MemoryDocumentStorage(); var cachedReportSource = new DevExpress.XtraPrinting.Caching.CachedReportSource(report, storage); ReportPrintTool printTool = new ReportPrintTool(cachedReportSource); printTool.Print(); }
public void RptEntry( ) { try { if (!ApplicationDeployment.IsNetworkDeployed) { return; } string queryString = ApplicationDeployment.CurrentDeployment.ActivationUri.Query; NameValueCollection nameValueTable = HttpUtility.ParseQueryString(queryString); if (nameValueTable.Count == 0) { return; } string form = nameValueTable["form"]; string func = nameValueTable["func"]; if (form == "Form_THBJSearch") { if (func == "jtdy") { RP_JTDJ rpt = new RP_JTDJ(nameValueTable); using (ReportPrintTool printTool = new ReportPrintTool(rpt)) { // printTool.ShowPreviewDialog(); printTool.Print(); } } } else if (form == "Form_Kfzydd_3F") { if (func == "phd") { RP_JTDJ rpt = new RP_JTDJ(nameValueTable); using (ReportPrintTool printTool = new ReportPrintTool(rpt)) { printTool.ShowPreviewDialog(); // printTool.Print(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button4_Click(object sender, RoutedEventArgs e) { ReportAfleverEtiket report = new ReportAfleverEtiket(); report.CreateDocument(); // report.PrinterName = LocalPrintServer.GetDefaultPrintQueue().Name; using (ReportPrintTool printTool = new ReportPrintTool(report)) { printTool.Print(); } }
public void Print() { RequestParameters = false; CreateDocument(); using (var printTool = new ReportPrintTool(this)) { //printTool.PrintDialog(); printTool.Print(BaseControl.PrinterSetting.InkJet); } }
private void btnControl_btnEventPrint_Click(object sender, EventArgs e) { try { using (ReportPrintTool printTool = new ReportPrintTool(rpt)) { printTool.Print(); } } catch (Exception) { } }
void settingsControl_PrintClick(object sender, EventArgs e) { using(ReportPrintTool tool = new ReportPrintTool(report)) tool.Print(printControl.SelectedPrinterName); }