内部标签打印.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. using FastReport;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.ComponentModel;
  5. using System.Data;
  6. using System.Drawing;
  7. using System.Linq;
  8. using System.Text;
  9. using System.Windows.Forms;
  10. using UAS_LabelMachine.Entity;
  11. using UAS_LabelMachine.PublicMethod;
  12. namespace UAS_LabelMachine
  13. {
  14. public partial class 内部标签打印 : Form
  15. {
  16. DataHelper dh = SystemInf.dh;
  17. string PrintList;
  18. Report InsideLabel = new Report();
  19. public 内部标签打印(string printli)
  20. {
  21. PrintList = printli;
  22. InitializeComponent();
  23. }
  24. bool IninLoad = true;
  25. private void 附件内容打印_Load(object sender, EventArgs e)
  26. {
  27. }
  28. private void Confirm_Click(object sender, EventArgs e)
  29. {
  30. }
  31. private void Button_CheckedChanged(object sender, EventArgs e)
  32. {
  33. }
  34. private void Y_KeyDown(object sender, KeyEventArgs e)
  35. {
  36. if (e.KeyCode == Keys.Enter)
  37. {
  38. string[] data = Barcode.Text.Split(',');
  39. if (data.Length < 5)
  40. {
  41. MessageBox.Show("采集数据格式不正确,请重新采集");
  42. }
  43. InsideLabel.Load(@"C:\打印标签\S8柏怡LP.frx");
  44. InsideLabel.SetParameterValue("物料编号", data[0]);
  45. InsideLabel.SetParameterValue("数量", data[1].Replace("Q",""));
  46. InsideLabel.SetParameterValue("DC", data[2].Replace("9D",""));
  47. InsideLabel.SetParameterValue("品牌", Brand.Text);
  48. InsideLabel.SetParameterValue("LotNo", data[4]);
  49. InsideLabel.PrintSettings.ShowDialog = false;
  50. InsideLabel.PrintSettings.Printer = PrintList;
  51. InsideLabel.Print();
  52. }
  53. }
  54. }
  55. }