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 Imprimir() { try { XINV_Rpt017_Rpt Reporte = new XINV_Rpt017_Rpt(); Reporte.P_IdSucursal_origen.Value = infoTransferencia.IdSucursalOrigen; Reporte.P_IdBodega_origen.Value = infoTransferencia.IdBodegaOrigen; Reporte.P_IdTransferencia.Value = infoTransferencia.IdTransferencia; Reporte.RequestParameters = false; DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(Reporte); pt.AutoShowParametersPanel = false; Reporte.ShowPreviewDialog(); if (infoTransferencia.IdGuia != null && infoTransferencia.IdGuia != 0 && MessageBox.Show("Desea imprimir la guia?", param.Nombre_sistema, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { XINV_NAT_Rpt001_Rpt Rpt = new XINV_NAT_Rpt001_Rpt(); Rpt.PIdEmpresa.Value = param.IdEmpresa; Rpt.PIdGuia.Value = infoTransferencia.IdGuia ?? 0; Rpt.RequestParameters = false; DevExpress.XtraReports.UI.ReportPrintTool ptg = new DevExpress.XtraReports.UI.ReportPrintTool(Rpt); ptg.AutoShowParametersPanel = false; Rpt.ShowPreviewDialog(); } } catch (Exception ex) { busLogError.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ucGe_Menu_event_btnImprimir_Click(object sender, EventArgs e) { try { XINV_Rpt007_rpt Reporte = new XINV_Rpt007_rpt(); Reporte.RequestParameters = false; Reporte.IdEmpresa.Value = param.IdEmpresa; Reporte.IdSucursal.Value = Convert.ToInt32(Ctrl_SucBod.cmb_sucursal.EditValue); Reporte.IdBodega.Value = Convert.ToInt32(Ctrl_SucBod.cmb_bodega.EditValue); Reporte.IdNunAjusteFisico.Value = Convert.ToDecimal(txtNumAjusteFisico.Text); Reporte.TipoMovimientoIngreso.Value = Ctrl_MoviIngreso.get_TipoMoviInvInfo().IdMovi_inven_tipo; Reporte.TipoMovimientoEgreso.Value = Ctrl_MoviEgreso.get_TipoMoviInvInfo().IdMovi_inven_tipo; DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(Reporte); pt.AutoShowParametersPanel = false; Reporte.ShowPreviewDialog(); return; } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ImprimirBoletasdeInventario() { DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile("./Reportes/rptBoletasInv.repx", true); SqlDataSource sqlDataSource = report.DataSource as SqlDataSource; SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "sqlDataSource1"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["IDBodega"].Value = Convert.ToInt32(GetDefaultValue(this.slkupBodega)); report.Parameters["IDProducto"].Value = Convert.ToInt32(GetDefaultValue(this.slkupProducto)); report.Parameters["Clasif1"].Value = Convert.ToInt32(GetDefaultValue(this.slkupClasif1)); report.Parameters["Clasif2"].Value = Convert.ToInt32(GetDefaultValue(this.slkupClasif2)); report.Parameters["Clasif3"].Value = Convert.ToInt32(GetDefaultValue(this.slkupClasif3)); report.Parameters["Clasif4"].Value = Convert.ToInt32(GetDefaultValue(this.slkupClasif4)); report.Parameters["Clasif5"].Value = Convert.ToInt32(GetDefaultValue(this.slkupClasif5)); report.Parameters["Clasif6"].Value = Convert.ToInt32(GetDefaultValue(this.slkupClasif6)); report.Parameters["ConsolidaByProducto"].Value = Convert.ToBoolean(swichtAgrupa.EditValue); // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); }
void ofrmListarFormatos_FormClosed(object sender, FormClosedEventArgs e) { frmSeleccionFormatoCheque ofrm = (frmSeleccionFormatoCheque)sender; String path = Path.Combine(Directory.GetCurrentDirectory(), "FormatosCheques", string.Format("Formato-{0}.repx", ofrm.IDFormato)).ToString(); DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); SqlDataSource sqlDataSource = report.DataSource as SqlDataSource; SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "sqlDataSource1"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["Numero"].Value = Convert.ToInt32(_currentRow["Numero"]); report.Parameters["IDCuentaBanco"].Value = Convert.ToInt32(_currentRow["IDCuentaBanco"]);; report.Parameters["IDTipo"].Value = Convert.ToInt32(_currentRow["IDTipo"]);; report.Parameters["IDSubTipo"].Value = Convert.ToInt32(_currentRow["IDSubTipo"]);; // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); SetChequeImpreso(); }
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 } }
public static void ShowPrintPreview(DevExpress.XtraReports.IReport report, bool dlg = false) { // Create a Print Tool and show the Print Preview form. DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(report); if (dlg) printTool.ShowRibbonPreviewDialog(); else printTool.ShowRibbonPreview(); }
private void btnSeleccionar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DateTime Fecha = Convert.ToDateTime(date_Fecha.EditValue.ToString()); string tfamini, tfamfin, tsubini, tsubfin, tincluyecero; if (glue_FamIni.EditValue == null) { tfamini = "00"; } else { tfamini = glue_FamIni.EditValue.ToString(); } if (glue_FamFin.EditValue == null) { tfamfin = "99"; } else { tfamfin = glue_FamFin.EditValue.ToString(); } if (glue_SubIni.EditValue == null) { tsubini = "0000"; } else { tsubini = glue_SubIni.EditValue.ToString(); } if (glue_SubFin.EditValue == null) { tsubfin = "9999"; } else { tsubfin = glue_SubFin.EditValue.ToString(); } if (check_Cero.Checked) { tincluyecero = "S"; } else { tincluyecero = "N"; } Rpt_Inventario R = new Rpt_Inventario(Fecha.Year.ToString() + DosCero(Fecha.Month.ToString()) + DosCero(Fecha.Day.ToString()), glue_Empresas.EditValue.ToString(), tfamini, tfamfin, tsubini, tsubfin, tincluyecero); DevExpress.XtraReports.UI.ReportPrintTool Rpt = new DevExpress.XtraReports.UI.ReportPrintTool(R); Rpt.ShowPreviewDialog(); }
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 btnImprimir_ItemClick_1(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { String path = ""; if (_currentRow["Asiento"].ToString() != "") { //Obtener el listado de formatos DataSet dsFormatos = CuentaFormatoChequeDAC.GetData(Convert.ToInt32(_currentRow["IDCuentaBanco"]), -1); if (dsFormatos.Tables.Count > 0) { if (dsFormatos.Tables[0].Rows.Count > 0) { DataTable tmpTable = new DataTable(); DataView dv = new DataView(dsFormatos.Tables[0]); dv.RowFilter = "Activo=1"; tmpTable = dv.ToTable(); if (tmpTable.Rows.Count == 1) { //cargar el formato por defecto path = Path.Combine(Directory.GetCurrentDirectory(), "FormatosCheques", string.Format("Formato-{0}.repx", tmpTable.Rows[0]["IDFormato"].ToString())).ToString(); DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile(path, true); SqlDataSource sqlDataSource = report.DataSource as SqlDataSource; SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "sqlDataSource1"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["Numero"].Value = Convert.ToInt32(_currentRow["Numero"]); report.Parameters["IDCuentaBanco"].Value = Convert.ToInt32(_currentRow["IDCuentaBanco"]); report.Parameters["IDTipo"].Value = Convert.ToInt32(_currentRow["IDTipo"]); report.Parameters["IDSubTipo"].Value = Convert.ToInt32(_currentRow["IDSubTipo"]); // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); SetChequeImpreso(); } else { //Seleccionar de la lista de formatos frmSeleccionFormatoCheque ofrmListarFormatos = new frmSeleccionFormatoCheque(tmpTable); ofrmListarFormatos.FormClosed += ofrmListarFormatos_FormClosed; ofrmListarFormatos.ShowDialog(); } } } } }
private void btnAceptar_Click(object sender, EventArgs e) { try { //Mostrar el reporte de Balance General String sMensaje = ""; if (this.dtpFechaInicial.EditValue == null) { sMensaje = " •Seleccione la fecha Inicial del Reporte \n\r "; } if (this.dtpFechaFinal.EditValue == null) { sMensaje = " •Seleccione la fecha final del Reporte \n\r "; } if (sMensaje != "") { MessageBox.Show("Han ocurrido los siguientes errores: \n\r " + sMensaje); return; } DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile("./Reporte/ReportesFinancieros/Plantilla/rptBalanceGeneral.repx", true); //Reporte.Asiento.rptAsiento report = new Reporte.Asiento.rptAsiento(); SqlDataSource sqlDataSource = report.DataSource as SqlDataSource; SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "sqlDataSource1"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["PFechaInicial"].Value = Convert.ToDateTime(this.dtpFechaInicial.EditValue); report.Parameters["PFechaFinal"].Value = Convert.ToDateTime(this.dtpFechaFinal.EditValue); report.Parameters["Moneda"].Value = (this.rgMoneda.SelectedIndex == 0) ? "L" : "D"; // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public static void ShowPrintPreview(DevExpress.XtraReports.IReport report, bool dlg = false) { // Create a Print Tool and show the Print Preview form. DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(report); if (dlg) { printTool.ShowRibbonPreviewDialog(); } else { printTool.ShowRibbonPreview(); } }
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(); }
public static void PrintBarcodes(List <int> rolls) { DevExpress.XtraReports.UI.XtraReport rpt = new DevExpress.XtraReports.UI.XtraReport(); rpt.CreateDocument(); rpt.PrintingSystem.ContinuousPageNumbering = false; foreach (int r in rolls) { Models.Stock.Reports.rptStockRollBarcode frm = new Models.Stock.Reports.rptStockRollBarcode(); frm.Parameters["StockRollID"].Value = r; frm.CreateDocument(); rpt.Pages.AddRange(frm.Pages); } DevExpress.XtraReports.UI.ReportPrintTool print = new DevExpress.XtraReports.UI.ReportPrintTool(rpt); print.ShowPreview(); }
public static void ShowPrintPreview(DevExpress.XtraReports.IReport report) { // Create a Print Tool and show the Print Preview form. DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(report); // Set watermark options. //printTool.PrintingSystem.Watermark.Image = Program.CompanyLogo; //printTool.PrintingSystem.Watermark.ImageAlign = System.Drawing.ContentAlignment.TopCenter; //printTool.PrintingSystem.Watermark.ImageTiling = false; //printTool.PrintingSystem.Watermark.ImageViewMode = DevExpress.XtraPrinting.Drawing.ImageViewMode.Stretch; //printTool.PrintingSystem.Watermark.ImageTransparency = 150; //printTool.PrintingSystem.Watermark.ShowBehind = false; //printTool.PrintingSystem.Watermark.PageRange = "1"; printTool.ShowRibbonPreviewDialog(); }
public static void ShowPrintPreview(DevExpress.XtraReports.IReport report) { // Create a Print Tool and show the Print Preview form. DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(report); // Set watermark options. //printTool.PrintingSystem.Watermark.Image = Program.CompanyLogo; //printTool.PrintingSystem.Watermark.ImageAlign = System.Drawing.ContentAlignment.TopCenter; //printTool.PrintingSystem.Watermark.ImageTiling = false; //printTool.PrintingSystem.Watermark.ImageViewMode = DevExpress.XtraPrinting.Drawing.ImageViewMode.Stretch; //printTool.PrintingSystem.Watermark.ImageTransparency = 150; //printTool.PrintingSystem.Watermark.ShowBehind = false; //printTool.PrintingSystem.Watermark.PageRange = "1"; printTool.ShowRibbonPreviewDialog(); }
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 btnPrint_Click(object sender, EventArgs e) { List <Trademark> tm_list = new List <Trademark>(); if (rbPrintChoosen.Checked) { if (gridView1.SelectedRowsCount > 0) { int Id = Convert.ToInt32(gridView1.GetRowCellValue(gridView1.GetSelectedRows()[0], gridView1.Columns["Id"]).ToString()); tm_list = tempRecList.Where(i => i.Id == Id).ToList(); //.First() } } else if (rbPrintAll.Checked) { //tm_list = filteredRecs; for (int m = 0; m < gridView1.RowCount; m++) { int Id = Convert.ToInt32(gridView1.GetRowCellValue(m, "Id").ToString()); tm_list.Add(tempRecList.Where(i => i.Id == Id).First()); } } List <Trademark_Full> TM_Full_List = new List <Trademark_Full>(); foreach (Trademark tm in tm_list) { TM_Full_List.Add(new Trademark_Full(tm)); } if (TM_Full_List.Count > 0) { BindingList <Trademark_Full> tmBList = new BindingList <Trademark_Full>(TM_Full_List); //send tm_list to report Report_TmBasic rep_tmBasic = new Report_TmBasic(tmBList); DevExpress.XtraReports.UI.ReportPrintTool RepPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rep_tmBasic); //rep_tmBasic.ShowPreviewMarginLines = false; RepPrintTool.PreviewForm.AllowFormSkin = false; RepPrintTool.ShowPreview(); } }
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(); }
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(); } }
private void btnImprimir_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile("./Reportes/rptSolicitudCompra.repx", true); SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "DataSource"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["IDSolicitudCompra"].Value = Convert.ToInt32(this.txtIDSolicitud.Tag.ToString().Trim()); // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); }
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(); }
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 btnAceptar_Click(object sender, EventArgs e) { //Obtener todas las variables int BaseReporte = 0; int Moneda = 1; BaseReporte = Convert.ToInt32(this.rgBaseReporte.EditValue); Moneda = Convert.ToInt32(this.rgMoneda.EditValue); //guarar los parametros de centros y Cuentas if (ReportesDAC.SetCuentaCentroReporte("", sCentrosSelected, 1, sUsuario)) { //Mostrar el reporte DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile("./Reporte/ReportesFinancieros/Plantilla/rptEstadoResultado.repx", true); SqlDataSource sqlDataSource = report.DataSource as SqlDataSource; SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "sqlDataSource1"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["FechaInicial"].Value = Convert.ToDateTime(this.dtFechaDesde.EditValue); report.Parameters["FechaFinal"].Value = Convert.ToDateTime(this.dtFechaHasta.EditValue); report.Parameters["Moneda"].Value = Moneda; report.Parameters["BaseReporte"].Value = BaseReporte; // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); } }
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 { } }
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 btnPrint_Click(object sender, EventArgs e) { List <Trademark> tm_list = new List <Trademark>(); if (rbPrintChoosen.Checked) { if (dgvTempRecs.SelectedRows.Count > 0) { int Id = Convert.ToInt32(dgvTempRecs.SelectedRows[0].Cells["tmp_Id"].Value.ToString()); tm_list = tempRecList.Where(i => i.Id == Id).ToList(); //.First() } } else if (rbPrintAll.Checked) { tm_list = filteredRecs; } List <Trademark_Full> TM_Full_List = new List <Trademark_Full>(); foreach (Trademark tm in tm_list) { TM_Full_List.Add(new Trademark_Full(tm)); } if (TM_Full_List.Count > 0) { BindingList <Trademark_Full> tmBList = new BindingList <Trademark_Full>(TM_Full_List); //send tm_list to report Report_TmBasic rep_tmBasic = new Report_TmBasic(tmBList); DevExpress.XtraReports.UI.ReportPrintTool RepPrintTool = new DevExpress.XtraReports.UI.ReportPrintTool(rep_tmBasic); //rep_tmBasic.ShowPreviewMarginLines = false; RepPrintTool.PreviewForm.AllowFormSkin = false; RepPrintTool.ShowPreview(); } }
void ucGe_Menu_Superior_Mant1_event_btnImprimir_Click(object sender, EventArgs e) { try { XINV_Rpt003_Rpt Reporte = new XINV_Rpt003_Rpt(); Reporte.Parameters["IdEmpresa"].Value = param.IdEmpresa; Reporte.Parameters["IdSucursal"].Value = ucGe_Sucursal.get_SucursalInfo().IdSucursal; Reporte.Parameters["IdBodega"].Value = null; Reporte.Parameters["IdMovi_inven_tipo"].Value = cmbTipoMovi.get_TipoMoviInvInfo().IdMovi_inven_tipo; Reporte.Parameters["IdNumMovi"].Value = Convert.ToDecimal(txtNumIngreso.Text); Reporte.RequestParameters = false; DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(Reporte); pt.AutoShowParametersPanel = false; Reporte.ShowPreviewDialog(); } catch (Exception ex) { Log_Error_bus = new tb_sis_Log_Error_Vzen_Bus(); Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnImprimir_Click(object sender, EventArgs e) { try { info_guia = (in_Guia_x_traspaso_bodega_Info)gridView_OC_x_Guia.GetRow(RowHandle); if (info_guia != null) { XINV_NAT_Rpt001_Rpt Reporte = new XINV_NAT_Rpt001_Rpt(); Reporte.PIdEmpresa.Value = param.IdEmpresa; Reporte.PIdGuia.Value = info_guia.IdGuia; Reporte.RequestParameters = false; DevExpress.XtraReports.UI.ReportPrintTool pt = new DevExpress.XtraReports.UI.ReportPrintTool(Reporte); pt.AutoShowParametersPanel = false; Reporte.ShowPreviewDialog(); } } catch (Exception ex) { Log_Error_bus.Log_Error(ex.ToString()); MessageBox.Show(ex.ToString(), param.Nombre_sistema, MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnExportar_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (this.slkupProducto.EditValue != null || this.slkupProducto.EditValue.ToString() != "") { if (this.TabControl.SelectedTabPageIndex == 0 || this.TabControl.SelectedTabPageIndex == 1 || this.TabControl.SelectedTabPageIndex == 2) { DevExpress.XtraReports.UI.XtraReport report = DevExpress.XtraReports.UI.XtraReport.FromFile("./Reportes/rptFichaProducto.repx", true); SqlDataSource sqlDataSource = report.DataSource as SqlDataSource; SqlDataSource ds = report.DataSource as SqlDataSource; ds.ConnectionName = "sqlDataSource1"; String sNameConexion = (Security.Esquema.Compania == "CEDETSA") ? "StringConCedetsa" : "StringConDasa"; System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder(System.Configuration.ConfigurationManager.ConnectionStrings[sNameConexion].ConnectionString); ds.ConnectionParameters = new DevExpress.DataAccess.ConnectionParameters.MsSqlConnectionParameters(builder.DataSource, builder.InitialCatalog, builder.UserID, builder.Password, MsSqlAuthorizationType.SqlServer); // Obtain a parameter, and set its value. report.Parameters["IDProducto"].Value = Convert.ToInt32(this.slkupProducto.EditValue); report.Parameters["Descr"].Value = "*"; // Show the report's print preview. DevExpress.XtraReports.UI.ReportPrintTool tool = new DevExpress.XtraReports.UI.ReportPrintTool(report); tool.ShowPreview(); } else if (this.TabControl.SelectedTabPageIndex == 3) { ExportarToExcel(this.gridView1, "Existencias Inventario", "Existencias"); } else if (this.TabControl.SelectedTabPageIndex == 4) { ExportarToExcel(this.gridView2, "Transacciones Inventario", "Transacciones"); } } }
private void button4_Click(object sender, EventArgs e) { var R = new XtraReport1(); R.Filling(LR); var RPT = new DevExpress.XtraReports.UI.ReportPrintTool(R); RPT.ShowPreview(); }
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(); }
private void печатьToolStripMenuItem_Click(object sender, EventArgs e) { if (textBox1.Text != string.Empty && textBox2.Text != string.Empty) { switch (comboBox1.Text) { case "Квартира": { Rep = new DevExpress.XtraReports.UI.ReportPrintTool(new FReport() { DataSource = new BindingSource() { DataSource = GetDataFlat() } }); Rep.Report.CreateDocument(false); Rep.ShowPreview(); }; break; case "Дом": { Rep = new DevExpress.XtraReports.UI.ReportPrintTool(new HReport() { DataSource = new BindingSource() { DataSource = GetDataHouse() } }); Rep.Report.CreateDocument(false); Rep.ShowPreview(); }; break; case "Земельный участок": { Rep = new DevExpress.XtraReports.UI.ReportPrintTool(new LReport() { DataSource = new BindingSource() { DataSource = GetDataLand() } }); Rep.Report.CreateDocument(false); Rep.ShowPreview(); }; break; case "Коммерческая недвижимость": { Rep = new DevExpress.XtraReports.UI.ReportPrintTool(new LbReport() { DataSource = new BindingSource() { DataSource = new Land() { Name = textBox1.Text, Phone = textBox2.Text, S = textBox7.Text, Far = textBox8.Text, Type = comboBox4.Text, Emid = checkBox1.Checked, Q = checkBox2.Checked, P = textBox6.Text, PForm = comboBox9.Text } } }); Rep.Report.CreateDocument(false); Rep.ShowPreview(); }; break; default: return; } } }
private void btnPrintView_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (!dxValidationProvider1.Validate()) { XtraMessageBox.Show("数据完整性校验失败. ", "错误提示", MessageBoxButtons.OK); return; } rptPatientRegist rpt = new rptPatientRegist(patientReg); DevExpress.XtraReports.UI.ReportPrintTool rptPrint = new DevExpress.XtraReports.UI.ReportPrintTool(rpt); rptPrint.ShowPreviewDialog(); }
private void mbRetirementXRDofatDetails_ItemClick(object sender, ItemClickEventArgs e) { XRep.XRDofatDetails rep = new XRep.XRDofatDetails(); // Create a Print Tool and show the Print Preview form. DevExpress.XtraReports.UI.ReportPrintTool printTool = new DevExpress.XtraReports.UI.ReportPrintTool(rep); printTool.ShowRibbonPreviewDialog(); }
private void btnRpt_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { if (pATIENT_MachineScheduleBindingSource.Current == null) { XtraMessageBox.Show("请选择需要生成报表的患者基本记录."); return; } if (lstBloodCleanup.Count() < 1) { XtraMessageBox.Show("未找到血液净化相关记录."); return; } PATIENT_REGIST p = db.FirstOrDefault<PATIENT_REGIST>("where id = @0", new object[] { ((MACHINE_SCHEDULE)pATIENT_MachineScheduleBindingSource.Current).REG_ID }); if (p != null) { Rpt_bloodCleanup rpt = new Rpt_bloodCleanup(p.NAME, Convert.ToInt32(p.AGE), p.SEX, lstProcess, lstBloodCleanup[0], db.Fetch<VALUE_CODE>("")); DevExpress.XtraReports.UI.ReportPrintTool rptPrint = new DevExpress.XtraReports.UI.ReportPrintTool(rpt); rptPrint.ShowPreview(); rpt.SetDspMember(); } else { XtraMessageBox.Show("未找到该患者的挂号登记信息.", "错误提示"); } }
private void Print() { var P = new DevExpress.XtraReports.UI.ReportPrintTool(new XtraReport1() { DataSource = new BindingSource() { DataSource = GetData() } }); P.Report.CreateDocument(false); P.ShowPreview(); }
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 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)); } }
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); } }
/// <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(); }