添加日报打印

This commit is contained in:
gongxh
2022-05-17 14:50:55 +08:00
parent 103708143e
commit 47c68facc3
6 changed files with 176 additions and 82 deletions

View File

@@ -323,6 +323,8 @@ namespace CleanMachineHMI.FrmUserControl
/// </summary>
private void Instance_OnReadFinish()
{
Console.WriteLine("数据变化");
cbt_RunStatusTran.BackColor = _device.CleanMacRunStatusNew ? Color.Lime : Color.Gray;
cbt_Brush1StatusTran.BackColor = _device.Hairbrush1Selection ? Color.Lime : Color.Gray;

View File

@@ -32,6 +32,14 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonPanel2 = new Krypton.Toolkit.KryptonPanel();
this.kryptonGroupBox3 = new Krypton.Toolkit.KryptonGroupBox();
this.kryptonDataGridView1 = new Krypton.Toolkit.KryptonDataGridView();
this.colDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColDayOfWeek = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColStartTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColEndTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColMachineHours = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColCleaned = new Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn();
this.ColScrap = new Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn();
this.colOperators = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.kryptonGroupBox4 = new Krypton.Toolkit.KryptonGroupBox();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.kbt_Reset = new Krypton.Toolkit.KryptonButton();
@@ -41,14 +49,7 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel();
this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.colDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColDayOfWeek = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColStartTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColEndTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColMachineHours = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ColCleaned = new Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn();
this.ColScrap = new Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn();
this.colOperators = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.kryptonButton1 = new Krypton.Toolkit.KryptonButton();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
this.kryptonPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit();
@@ -118,6 +119,78 @@ namespace CleanMachineHMI.FrmUserControl
this.kryptonDataGridView1.Size = new System.Drawing.Size(1020, 500);
this.kryptonDataGridView1.TabIndex = 3;
//
// colDate
//
this.colDate.DataPropertyName = "Date";
this.colDate.HeaderText = "Date";
this.colDate.Name = "colDate";
this.colDate.ReadOnly = true;
this.colDate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colDate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.colDate.Width = 41;
//
// ColDayOfWeek
//
this.ColDayOfWeek.DataPropertyName = "DayOfWeek";
this.ColDayOfWeek.HeaderText = "DayOfWeek";
this.ColDayOfWeek.Name = "ColDayOfWeek";
this.ColDayOfWeek.ReadOnly = true;
this.ColDayOfWeek.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ColDayOfWeek.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.ColDayOfWeek.Width = 79;
//
// ColStartTime
//
this.ColStartTime.DataPropertyName = "StartTime";
this.ColStartTime.HeaderText = "StartTime";
this.ColStartTime.Name = "ColStartTime";
this.ColStartTime.ReadOnly = true;
this.ColStartTime.Width = 86;
//
// ColEndTime
//
this.ColEndTime.DataPropertyName = "EndTime";
this.ColEndTime.HeaderText = "EndTime";
this.ColEndTime.Name = "ColEndTime";
this.ColEndTime.ReadOnly = true;
this.ColEndTime.Width = 82;
//
// ColMachineHours
//
this.ColMachineHours.DataPropertyName = "MachineHours";
this.ColMachineHours.HeaderText = "MachineHours";
this.ColMachineHours.Name = "ColMachineHours";
this.ColMachineHours.ReadOnly = true;
this.ColMachineHours.Width = 114;
//
// ColCleaned
//
this.ColCleaned.AllowDecimals = false;
this.ColCleaned.DataPropertyName = "Cleaned";
this.ColCleaned.HeaderText = "Cleaned";
this.ColCleaned.Name = "ColCleaned";
this.ColCleaned.ReadOnly = true;
this.ColCleaned.Width = 60;
//
// ColScrap
//
this.ColScrap.AllowDecimals = false;
this.ColScrap.DataPropertyName = "Scrap";
this.ColScrap.HeaderText = "Scrap";
this.ColScrap.Name = "ColScrap";
this.ColScrap.ReadOnly = true;
this.ColScrap.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ColScrap.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.ColScrap.Width = 65;
//
// colOperators
//
this.colOperators.DataPropertyName = "Operator";
this.colOperators.HeaderText = "Operator";
this.colOperators.Name = "colOperators";
this.colOperators.ReadOnly = true;
this.colOperators.Width = 83;
//
// kryptonGroupBox4
//
this.kryptonGroupBox4.CaptionOverlap = 0D;
@@ -142,6 +215,7 @@ namespace CleanMachineHMI.FrmUserControl
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33444F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33112F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F));
this.tableLayoutPanel2.Controls.Add(this.kryptonButton1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.kbt_Reset, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.kbt_Query, 1, 0);
this.tableLayoutPanel2.Location = new System.Drawing.Point(727, 48);
@@ -236,77 +310,18 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21);
this.kdtp_CreateEndTime.TabIndex = 7;
//
// colDate
// kryptonButton1
//
this.colDate.DataPropertyName = "Date";
this.colDate.HeaderText = "Date";
this.colDate.Name = "colDate";
this.colDate.ReadOnly = true;
this.colDate.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colDate.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.colDate.Width = 41;
//
// ColDayOfWeek
//
this.ColDayOfWeek.DataPropertyName = "DayOfWeek";
this.ColDayOfWeek.HeaderText = "DayOfWeek";
this.ColDayOfWeek.Name = "ColDayOfWeek";
this.ColDayOfWeek.ReadOnly = true;
this.ColDayOfWeek.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ColDayOfWeek.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
this.ColDayOfWeek.Width = 79;
//
// ColStartTime
//
this.ColStartTime.DataPropertyName = "StartTime";
this.ColStartTime.HeaderText = "StartTime";
this.ColStartTime.Name = "ColStartTime";
this.ColStartTime.ReadOnly = true;
this.ColStartTime.Width = 86;
//
// ColEndTime
//
this.ColEndTime.DataPropertyName = "EndTime";
this.ColEndTime.HeaderText = "EndTime";
this.ColEndTime.Name = "ColEndTime";
this.ColEndTime.ReadOnly = true;
this.ColEndTime.Width = 82;
//
// ColMachineHours
//
this.ColMachineHours.DataPropertyName = "MachineHours";
this.ColMachineHours.HeaderText = "MachineHours";
this.ColMachineHours.Name = "ColMachineHours";
this.ColMachineHours.ReadOnly = true;
this.ColMachineHours.Width = 114;
//
// ColCleaned
//
this.ColCleaned.AllowDecimals = false;
this.ColCleaned.DataPropertyName = "Cleaned";
this.ColCleaned.HeaderText = "Cleaned";
this.ColCleaned.Name = "ColCleaned";
this.ColCleaned.ReadOnly = true;
this.ColCleaned.Width = 60;
//
// ColScrap
//
this.ColScrap.AllowDecimals = false;
this.ColScrap.DataPropertyName = "Scrap";
this.ColScrap.HeaderText = "Scrap";
this.ColScrap.Name = "ColScrap";
this.ColScrap.ReadOnly = true;
this.ColScrap.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ColScrap.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.ColScrap.Width = 65;
//
// colOperators
//
this.colOperators.DataPropertyName = "Operator";
this.colOperators.HeaderText = "Operator";
this.colOperators.Name = "colOperators";
this.colOperators.ReadOnly = true;
this.colOperators.Width = 83;
this.kryptonButton1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.kryptonButton1.Location = new System.Drawing.Point(3, 3);
this.kryptonButton1.Name = "kryptonButton1";
this.kryptonButton1.Size = new System.Drawing.Size(91, 35);
this.kryptonButton1.TabIndex = 1;
this.kryptonButton1.Tag = "show";
this.kryptonButton1.Values.Text = "打印";
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
//
// frmOperatorReport
//
@@ -357,5 +372,6 @@ namespace CleanMachineHMI.FrmUserControl
private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColCleaned;
private Krypton.Toolkit.KryptonDataGridViewNumericUpDownColumn ColScrap;
private System.Windows.Forms.DataGridViewTextBoxColumn colOperators;
private Krypton.Toolkit.KryptonButton kryptonButton1;
}
}

View File

@@ -63,6 +63,9 @@ namespace CleanMachineHMI.FrmUserControl
}
private void frmParamater_Load(object sender, EventArgs e)
{
try
@@ -94,13 +97,20 @@ namespace CleanMachineHMI.FrmUserControl
private void kbt_Reset_Click(object sender, EventArgs e)
{
kdtp_CreateStartTime.Checked = false;
kdtp_CreateEndTime.Checked = false;
}
private void kryptonButton1_Click(object sender, EventArgs e)
{
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport("");
FastReport.Report report = new FastReport.Report();
report.Load("ReportMd\\operatorReport.frx");
report.RegisterData(list, "datas");
//report.Design();
report.Prepare();
report.Print();
}
}
}

View File

@@ -129,4 +129,16 @@
<metadata name="colOperators.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColStartTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColEndTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="ColMachineHours.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOperators.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>