当前位置: 首页>>代码示例>>C#>>正文


C# XtraReport.Print方法代码示例

本文整理汇总了C#中XtraReport.Print方法的典型用法代码示例。如果您正苦于以下问题:C# XtraReport.Print方法的具体用法?C# XtraReport.Print怎么用?C# XtraReport.Print使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XtraReport的用法示例。


在下文中一共展示了XtraReport.Print方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrintDialogRm

        public void PrintDialogRm(string operation,Infragistics.Win.UltraWinGrid.UltraGridRow uRow,DataTable dt)
        {
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            //var _RmcTempletFileName = Application.StartupPath + @"\Label\班次制令单.repx";
            var temPath = _RmcTempletFileName;     //_cTempletFileName;      //Application.StartupPath + @"\Label\" +   _cTempletFileName;

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);
            xtreport.PrinterName = _cPrinter;
            xtreport.RequestParameters = false;
            xtreport.ShowPrintStatusDialog = false;
            xtreport.ShowPrintMarginsWarning = false;

            var cFitemID = uRow.Cells["cFitemID"].Value.ToString();
            var cLotNo = uRow.Cells["FBatchNo"].Value.ToString();
            var cDefine2 = dt.Rows[0]["cDefine2"].ToString();
            var cSerialNumber = dt.Rows[0]["cSerialNumber"].ToString();
            var cInvCode = dt.Rows[0]["cInvCode"].ToString();
            var cInvName = dt.Rows[0]["cInvName"].ToString();
            var dDate= dt.Rows[0]["dDate"].ToString();
            var cInvStd = dt.Rows[0]["cInvStd"].ToString();
            var cFullName = dt.Rows[0]["cFullName"].ToString();
            var iQuantity = uRow.Cells["iQuantity"].Value.ToString();
            var cMemo = dt.Rows[0]["cMemo"].ToString();
            var cDefine1 = dt.Rows[0]["cDefine1"].ToString();

            //模板赋值
            DllWorkPrintLabel.SetParametersValue(xtreport, "cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cBarCode", "R*" + cFitemID + "*L*" + cLotNo + "*S*" + cSerialNumber + ";" + cDefine2);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvCode", cInvCode);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvName", cInvName);
            DllWorkPrintLabel.SetParametersValue(xtreport, "dDate", dDate);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvStd", cInvStd);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cFullName", txtcFullName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cVendor", cFullName);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cLotNo", cLotNo);
            DllWorkPrintLabel.SetParametersValue(xtreport, "iQuantity", iQuantity);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cMemo", cMemo);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cDefine1", cDefine1);
            if (dtpdDate.Checked)
                DllWorkPrintLabel.SetParametersValue(xtreport, "cVendorDate", dtpdDate.Value);
            //模板赋值
            switch (operation)
            {
                case "print":
                    xtreport.Print();
                    break;
                case "design":
                    xtreport.ShowDesigner();
                    break;
                case "preview":
                    xtreport.ShowPreview();
                    break;
            }

        }
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:63,代码来源:WorkTrackShiftOrder.cs

示例2: PrintDialog

        /// <summary>
        /// 打印操作
        /// </summary>
        /// <param name="operation"></param>
        public void PrintDialog(string operation)
        {
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            var temPath = Application.StartupPath + @"\Stencil\DeliveryOrder.repx";

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.Name = "DeliveryOrder";
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);

            xtreport.RequestParameters = false;
            xtreport.ShowPrintStatusDialog = false;
            xtreport.ShowPrintMarginsWarning = false;
            xtreport.DataSource = uGridChecks.DataSource;
            //模板赋值
            string cKey, cValue;
            for (var i = 0; i < uGridCheck.DisplayLayout.Bands[0].Columns.Count; i++)
            {
                cKey = uGridCheck.DisplayLayout.Bands[0].Columns[i].Key;
                cValue = uGridCheck.Rows[_iRowNo].Cells[i].Value.ToString();
                DLL.DllWorkPrintLabel.SetParametersValue(xtreport, cKey, cValue);
            }


            //模板赋值
            switch (operation)
            {
                case "print":
                    xtreport.Print();
                    break;
                case "design":
                    xtreport.ShowDesigner();
                    break;
                case "preview":
                    xtreport.ShowPreview();
                    break;
            }

        }
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:49,代码来源:WorkTrackPrintTransfer.cs

示例3: PrintDialog

        public void PrintDialog(string operation)
        {
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            var temPath = _cTempletFileName;     //_cTempletFileName;      //Application.StartupPath + @"\Label\" +   _cTempletFileName;

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);
            xtreport.PrinterName = _cPrinter;
            xtreport.RequestParameters = false;
            xtreport.ShowPrintStatusDialog = false;
            xtreport.ShowPrintMarginsWarning = false;

            //模板赋值
            DllWorkPrintLabel.SetParametersValue(xtreport, "cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cBarCode", "P*" + _FitemId + "*L*" + txtFBatchNo.Text + "*S*" );
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvCode", txtcInvCode.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvName", utecInvName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvStd", txtcInvStd.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cFullName", txtcFullName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "iQuantity", uneiQuantity.Value);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cMemo", txtcMemo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "dDate", dtpdDate.Value.ToShortDateString());
            DllWorkPrintLabel.SetParametersValue(xtreport, "cOrderNumber", txtcOrderNumber.Text);
            xtreport.DataSource = GetPrintData();
            //模板赋值
            switch (operation)
            {
                case "print":
                    xtreport.Print();
                    break;
                case "design":
                    xtreport.ShowDesigner();
                    break;
                case "preview":
                    xtreport.ShowPreview();
                    break;
            }

        }
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:46,代码来源:WorkTrackProductLabelPrint.cs

示例4: PrintDialog

        public void PrintDialog(string operation)
        {
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            var _cTempletFileName = Application.StartupPath + @"\Label\班次制令单.repx";
            var temPath = _cTempletFileName;      //Application.StartupPath + @"\Label\" +  _cTempletFileName;

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);
            xtreport.PrinterName = _cPrinter;
            xtreport.RequestParameters = false;
            xtreport.ShowPrintStatusDialog = false;
            xtreport.ShowPrintMarginsWarning = false;

            //模板赋值
            DllWorkPrintLabel.SetParametersValue(xtreport, "cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvCode", txtcInvCode.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvName", utecInvName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvStd", txtcInvStd.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cFullName", txtcFullName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cOrderNuber", txtcOrderNumber.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "FBatchNo", txtFBatchNo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "iQuantity", uneiQuantity.Value);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cDepartment", txtcDept.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "dDate", dtpdDate.Value.ToShortDateString());
            DllWorkPrintLabel.SetParametersValue(xtreport, "cMemo", txtcMemo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "批次", txtcMemo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "库位", txtcMemo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "库存", txtcMemo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "发货数", txtcMemo.Text);

            //xtreport.DataSource = dataInventory.BomDetail;
            DataSet ds = new DataSet();
            using (var con = new SqlConnection(BaseStructure.WmsCon))
            {
                using (var cmd = new SqlCommand { CommandType = CommandType.StoredProcedure, Connection = con })
                {
                    cmd.CommandText = "proc_Bomdetail";
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@BomID", bomID);
                    using (SqlDataAdapter dataAdapter = new SqlDataAdapter(cmd))
                    {
                        dataAdapter.Fill(ds);
                    }
                    cmd.Parameters.Clear();
                }
            }

            int count = 0;
            if(!int.TryParse(uneiQuantity.Value.ToString(), out count))
            {
                count = 0;
            }

            DataTable dt = null;
            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                dt = ds.Tables[0].Clone();
                dt.Columns.Add("发货数", typeof(int));
                //DataTable dt = ds.Tables[0];
                var dtE = ds.Tables[0].AsEnumerable();
                foreach (DataRow dr in GetBomDetail())
                {
                    var iquantity = Convert.ToDecimal(dr["iQuantity"]) * count;
                    var drs = dtE.Where(w => w.Field<string>("cInvCode") == dr["cInvCode"].ToString()).OrderBy(o => o.Field<string>("批次")).ToList();
                    //DataRow[] drs = dtE.Select(" cInvCode = '"+dr["cInvCode"].ToString()+"'").OrderBy("");
                    foreach (DataRow dr1 in drs)
                    {
                        if (iquantity >= 0)
                        {
                            var kc = Convert.ToDecimal(dr1["库存"]);
                            var fhs = kc > iquantity ? iquantity : kc;
                            //假如库存大于发货数,直接当前库位发货,如果小于发货数,当前库位发完当前数,并到下一个库位发剩余数量
                            iquantity = kc >= iquantity ? -1 : iquantity - kc;
                            DataRow drNew = dt.NewRow();
                            drNew["AutoID"] = dr1["AutoID"];
                            drNew["BomID"] = dr1["BomID"];
                            drNew["cInvCode"] = dr1["cInvCode"];
                            drNew["cInvName"] = dr1["cInvName"];
                            drNew["iQuantity"] = dr1["iQuantity"];
                            drNew["cUnitID"] = dr1["cUnitID"];
                            drNew["cUnitName"] = dr1["cUnitName"];
                            drNew["cInvStd"] = dr1["cInvStd"];
                            drNew["cFullName"] = dr1["cFullName"];
                            drNew["cMemo"] = dr1["cMemo"];
                            drNew["dAddTime"] = dr1["dAddTime"];
                            drNew["cFitemID"] = dr1["cFitemID"];
                            drNew["批次"] = dr1["批次"];
                            drNew["库位"] = dr1["库位"];
                            drNew["库存"] = dr1["库存"];
                            drNew["发货数"] = fhs;
                            dt.Rows.Add(drNew);
                        }
                    }
//.........这里部分代码省略.........
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:101,代码来源:WorkTrackShiftOrder.cs

示例5: DoStdPrint

        private void DoStdPrint(bool PrtPreView)
        {
            var proces = gcOrder.GetDataSource<V_ERP_PrintOrderPrd>().Where(k => k.Num > 0)
                .Select(k => new { k.ProceName, k.Guid, k.ProceUser }).ToList();

            var odrs = SerNoCaller.Calr_V_ERP_PrintOrderProce.Get(" where [email protected]", PrintSession);
            //var proces = SerNoCaller.Calr_V_ERP_PrintOrderProceDetail.Get(" where [email protected]", PrintSession);

            var pordrs = odrs.MapTo<List<V_ERP_PrintOrderProce>, List<PrtOrder>>();
            var prts = new List<ProcePrtInfo>();
            pordrs.ForEach(k => {
                prts.Add(new ProcePrtInfo() {
                    PrtOrder = k,
                    Detail = proces.Where(j => k.Guid == j.Guid && !j.ProceName.Equals("木工")).Select(j => new T_ERP_OrderProce { ProceName = j.ProceName, ProceUser = j.ProceUser }).ToList()
                });
                var mg = proces.FirstOrDefault(j => k.Guid == j.Guid && j.ProceName.Equals("木工"));
                if (mg != null) {
                    prts.Add(new ProcePrtInfo() {
                        PrtOrder = k,
                        Detail = new List<T_ERP_OrderProce> { new T_ERP_OrderProce { ProceName = mg.ProceName, ProceUser = mg.ProceUser } }
                    });
                }
            });

            var prtsys = new XtraReport();
            var rpt = new NewRptSub(prts);
            rpt.BindData();
            rpt.CreateDocument();
            prtsys.Pages.AddRange(rpt.Pages);
            SetPrintToolsVisible(prtsys);
            prtsys.PrintingSystem.ShowMarginsWarning = false;
            if (PrtPreView) {
                prtsys.ShowPreview();
            } else {
                prtsys.Print();
            }
        }
开发者ID:ZixiangBoy,项目名称:FAS,代码行数:37,代码来源:PrintPrdView.cs

示例6: printXtraReport

 private void printXtraReport(XtraReport report)
 {
     report.Print(settings.PrinterName);
 }
开发者ID:robertfall,项目名称:LAD,代码行数:4,代码来源:PrintEnrollmentAction.cs

示例7: PrintDialog

        /// <summary>
        /// 打印操作
        /// </summary>
        /// <param name="p"></param>
        private void PrintDialog(string p)
        {
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            var temPath = Application.StartupPath + @"\Stencil\TrackDeliveryOrder.repx";

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.Name = "TrackDeliveryOrder";
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);
            xtreport.RequestParameters = false;
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "cCode", txtcCode.Text);
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "cOrderType", cbxcOrderType.Text);
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "cCusName", utxtcCusName.Text);
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "dDate", dtpdDate.Text);
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "OrderDate", dtpOrderDate.Text);
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "DeliveryDate", dtpDeliveryDate.Text);
            DLL.DllWorkPrintLabel.SetParametersValue(xtreport, "cDepName", utecDepName.Text);
            //模板赋值
            switch (p)
            {
                case "print":
                    xtreport.Print();
                    break;
                case "design":
                    xtreport.ShowDesigner();
                    break;
                case "preview":
                    xtreport.ShowPreview();
                    break;
            }
        }
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:41,代码来源:WorkTrackDeliveryOrder.cs

示例8: PrintDialog

        public void PrintDialog(string operation)
        {
            if (string.IsNullOrEmpty(biEditTemplet.Caption))
            {
                MessageBox.Show(@"请先在 维护中心-模板管理,添加仓位标签项,再打开此界面!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);

                return;
            }

            var dt = new DataKis.StockPlacePrintDataTable();

            foreach (var uRow in uGridCheck.Rows.GetFilteredInNonGroupByRows())
            {
                var nRow = dt.NewStockPlacePrintRow();
                nRow.FSPID = int.Parse(uRow.Cells["FSPID"].Value.ToString());
                nRow.FNumber = uRow.Cells["FNumber"].Value.ToString();
                nRow.FName = uRow.Cells["FName"].Value.ToString();
                nRow.FFullName = uRow.Cells["FFullName"].Value.ToString();
                dt.Rows.Add(nRow);
            }
            if (dt.Rows.Count < 1)
            {
                MessageBox.Show(@"请先筛选要打印的数据!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     
                return;
            }
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            var temPath = _cTempletFileName;     //_cTempletFileName;      //Application.StartupPath + @"\Label\" +   _cTempletFileName;

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);
            xtreport.PrinterName = _cPrinter;
            xtreport.RequestParameters = false;
            xtreport.ShowPrintStatusDialog = false;
            xtreport.ShowPrintMarginsWarning = false;

            //模板赋值

            xtreport.DataSource = dt;
            //模板赋值
            switch (operation)
            {
                case "print":
                    xtreport.Print();
                    break;
                case "design":
                    xtreport.ShowDesigner();
                    break;
                case "preview":
                    xtreport.ShowPreview();
                    break;
            }
        }
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:60,代码来源:WorkStockPlaceLabelPrint.cs

示例9: PrintDialog

        /// <summary>
        /// 打印操作
        /// </summary>
        /// <param name="operation"></param>
        public void PrintDialog(string operation)
        {
            //当修改原数据是要进行保存后才能去打印
            if (biSave.Enabled == true)
            {
                MessageBox.Show("在原数据上进行修改时请先保存后再进行打印!!!");
            }
            
            var xtreport = new XtraReport();
            // _btApp = new BarTender.Application();
            //判断当前打印模版路径是否存在
            var temPath = _cTempletFileName;     //_cTempletFileName;      //Application.StartupPath + @"\Label\" +   _cTempletFileName;

            if (!File.Exists(temPath))
            {
                MessageBox.Show(@"当前路径下的打印模版文件不存在!", @"异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                xtreport.ShowDesigner();
                return;
            }
            xtreport.LoadLayout(temPath);
            xtreport.PrinterName = _cPrinter;
            xtreport.PrintingSystem.StartPrint += PrintingSystem_StartPrint;
            xtreport.RequestParameters = false;
            xtreport.ShowPrintStatusDialog = false;
            xtreport.ShowPrintMarginsWarning = false;
            
            //模板赋值
            DllWorkPrintLabel.SetParametersValue(xtreport, "cSerialNumber", lblTitleMain.lblcSerialNumber.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cBarCode", "R*" + _FitemId + "*L*" + txtcLotNo.Text + "*S*" + lblTitleMain.lblcSerialNumber.Text+";"+dtpcDefine2.Value.ToShortDateString());
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvCode", txtcInvCode.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvName", utecInvName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "dDate", dtpdDate.Value.ToShortDateString());
            DllWorkPrintLabel.SetParametersValue(xtreport, "cInvStd", txtcInvStd.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cFullName", txtcFullName.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cVendor", txtcVendor.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cLotNo", txtcLotNo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "iQuantity", uneiQuantity.Value);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cMemo", txtcMemo.Text);
            DllWorkPrintLabel.SetParametersValue(xtreport, "cDefine1", txtcDefine1.Text);
            if (dtpdDate.Checked)
                DllWorkPrintLabel.SetParametersValue(xtreport, "cVendorDate", dtpdDate.Value);
            //模板赋值
            switch (operation)
            {
                case "print":
                    xtreport.Print();
                    break;
                case "design":
                    xtreport.ShowDesigner();
                    break;
                case "preview":
                    xtreport.ShowPreview();
                    break;
            }

        }
开发者ID:JARANTeam,项目名称:JWMSH,代码行数:60,代码来源:WorkRmLabelPrint.cs


注:本文中的XtraReport.Print方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。