本文整理汇总了C#中XtraReport.ShowDesigner方法的典型用法代码示例。如果您正苦于以下问题:C# XtraReport.ShowDesigner方法的具体用法?C# XtraReport.ShowDesigner怎么用?C# XtraReport.ShowDesigner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XtraReport
的用法示例。
在下文中一共展示了XtraReport.ShowDesigner方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
}
示例2: 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);
}
}
//.........这里部分代码省略.........
示例3: 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;
}
}
示例4: 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;
}
}
示例5: btnPrintPreview_Click
private void btnPrintPreview_Click(object sender, EventArgs e)
{
XtraReport r = new XtraReport();
DataSet ds = new DataSet();
DataTable dtCompany = new DataTable("Company");
dtCompany.Columns.Add("Tên đơn vị");
dtCompany.Columns.Add("Tên giao dịch");
dtCompany.Columns.Add("Mã số thuế");
dtCompany.Columns.Add("Lĩnh vực hoạt động");
dtCompany.Columns.Add("Điện thoại");
dtCompany.Columns.Add("Fax");
dtCompany.Columns.Add("Email");
dtCompany.Columns.Add("Website");
dtCompany.Columns.Add("Địa chỉ đơn vị");
dtCompany.Columns.Add("Giám đốc");
dtCompany.Columns.Add("Kế toán");
dtCompany.Columns.Add("Thủ quỹ");
DataRow row = dtCompany.NewRow();
object tmp;
EasyParam.GetValue("Tên đơn vị", out tmp, ParamCategory.CompanyInfo, "TÊN DOANH NGHIỆP", DataType.String);
row["Tên đơn vị"] = tmp;
EasyParam.GetValue("Tên giao dịch", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Tên giao dịch"] = tmp;
EasyParam.GetValue("Mã số thuế", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Mã số thuế"] = tmp;
EasyParam.GetValue("Lĩnh vực hoạt động", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Lĩnh vực hoạt động"] = tmp;
EasyParam.GetValue("Điện thoại", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Điện thoại"] = tmp;
EasyParam.GetValue("Fax", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Fax"] = tmp;
EasyParam.GetValue("Email", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Email"] = tmp;
EasyParam.GetValue("Website", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Website"] = tmp;
EasyParam.GetValue("Địa chỉ đơn vị", out tmp, ParamCategory.CompanyInfo, "", DataType.String);
row["Địa chỉ đơn vị"] = tmp;
EasyParam.GetValue("Giám đốc", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Giám đốc"] = tmp;
EasyParam.GetValue("Kế toán", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Kế toán"] = tmp;
EasyParam.GetValue("Thủ quỹ", out tmp, ParamCategory.CompanyInfo, string.Empty, DataType.String);
row["Thủ quỹ"] = tmp;
dtCompany.Rows.Add(row);
DataTable dtInvoice = new DataTable("Invoice");
dtInvoice.Columns.Add("InvoiceCode");
dtInvoice.Columns.Add("InvoiceDate", typeof(DateTime));
dtInvoice.Columns.Add("EntityName");
dtInvoice.Columns.Add("EntityAddress");
dtInvoice.Columns.Add("VoucherCode");
dtInvoice.Columns.Add("VoucherDate", typeof(DateTime));
dtInvoice.Columns.Add("InvoiceNote");
dtInvoice.Columns.Add("Total", typeof(decimal));
dtInvoice.Columns.Add("Bằng chữ");
DataRow rowInvoice = dtInvoice.NewRow();
rowInvoice["InvoiceCode"] = _invoice.InvoiceCode;
rowInvoice["InvoiceDate"] = _invoice.InvoiceDate;
rowInvoice["InvoiceNote"] = _invoice.InvoiceNote;
rowInvoice["EntityName"] = _invoice.EntityName;
rowInvoice["EntityAddress"] = _invoice.EntityAddress;
rowInvoice["VoucherCode"] = _invoice.VoucherCode;
rowInvoice["VoucherDate"] = _invoice.VoucherDate;
rowInvoice["Total"] = _invoice.Total;
rowInvoice["Bằng chữ"] = lbTotalString.Text+"\r\nABCD";
dtInvoice.Rows.Add(rowInvoice);
ds.Tables.Add(dtCompany);
ds.Tables.Add(dtInvoice);
if (_invoiceType.InvoiceTypeName == Constant.INVOICE_TYPE_THU)
r.LoadLayout(Application.StartupPath + @"\Reports\phieuthu.repx");
else if (_invoiceType.InvoiceTypeName == Constant.INVOICE_TYPE_CHI)
r.LoadLayout(Application.StartupPath + @"\Reports\phieuchi.repx");
r.DataSource = ds;
//r.ShowPreview();
r.ShowDesigner();
}
示例6: 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;
}
}
示例7: 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;
}
}
示例8: 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;
}
}