77 lines
2.4 KiB
C#
77 lines
2.4 KiB
C#
using System;
|
|
using System.Drawing;
|
|
using System.Collections;
|
|
using System.ComponentModel;
|
|
using DevExpress.XtraReports.UI;
|
|
using System.Data;
|
|
|
|
namespace WCS
|
|
{
|
|
public partial class XtraReport1 : DevExpress.XtraReports.UI.XtraReport
|
|
{
|
|
public XtraReport1()
|
|
{
|
|
InitializeComponent();
|
|
this.ShowPrintStatusDialog = false;
|
|
}
|
|
public void SetBindData(DataTable table, string printId)
|
|
{
|
|
this.lblbarCode.Text = table.Rows[0]["BARCODE"].ToString();
|
|
this.lblbarCode2.Text = table.Rows[0]["BARCODE"].ToString();
|
|
this.lblguige.Text = table.Rows[0]["SPECIFICATION"].ToString();
|
|
this.lbllenth.Text = table.Rows[0]["GLENGTH"].ToString();
|
|
this.lblgzl.Text = table.Rows[0]["gzlname"].ToString();//工字号ID
|
|
|
|
this.lblXJ.Text = table.Rows[0]["rxxj"].ToString();
|
|
this.lbldate.Text = table.Rows[0]["CREATE_DATE"].ToString().Substring(0,10);
|
|
this.lbljianju.Text = table.Rows[0]["rxjj"].ToString();
|
|
this.lblzhangli.Text = table.Rows[0]["rxzl"].ToString();
|
|
//this.lblgoosId.Text = table.Rows[0]["GOODS_ID"].ToString();
|
|
this.lblgoosName.Text = table.Rows[0]["GOODS_NAME"].ToString();
|
|
PrintingSystem.ShowMarginsWarning = false;
|
|
PrintData(printId);
|
|
}
|
|
|
|
public void PrintData(string pt)
|
|
{
|
|
try
|
|
{
|
|
string prot = "";
|
|
if (pt == "1")
|
|
{
|
|
prot = "ZDesigner ZD888-203dpi ZPL";
|
|
}
|
|
else
|
|
{
|
|
prot = "ZDesigner ZD888-203dpi ZPL (副本 1)";
|
|
}
|
|
if (prot.Trim().Length > 0)
|
|
{
|
|
this.PrinterName = prot;
|
|
}
|
|
this.Print(prot);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private static XtraReport1 reportPickWave;
|
|
/// <summary>
|
|
/// 实例化BarCodeReport的一个对象
|
|
/// </summary>
|
|
/// <returns>BarCodeReport对象</returns>
|
|
public static XtraReport1 GetInstance(string barCodeText, float barCodeModule)
|
|
{
|
|
reportPickWave = new XtraReport1();
|
|
// reportPickWave.SaveLayout("C:\\abc.rep");
|
|
return reportPickWave;
|
|
}
|
|
|
|
|
|
}
|
|
}
|