diff --git a/CleanMachineHMI/CleanMachineHMI.csproj b/CleanMachineHMI/CleanMachineHMI.csproj index f2191da..7711319 100644 --- a/CleanMachineHMI/CleanMachineHMI.csproj +++ b/CleanMachineHMI/CleanMachineHMI.csproj @@ -88,6 +88,9 @@ PreserveNewest + + PreserveNewest + diff --git a/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs b/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs index f70223c..dcba3e9 100644 --- a/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs +++ b/CleanMachineHMI/FrmUserControl/frmMainDetailNew.cs @@ -323,6 +323,8 @@ namespace CleanMachineHMI.FrmUserControl /// private void Instance_OnReadFinish() { + + Console.WriteLine("数据变化"); cbt_RunStatusTran.BackColor = _device.CleanMacRunStatusNew ? Color.Lime : Color.Gray; cbt_Brush1StatusTran.BackColor = _device.Hairbrush1Selection ? Color.Lime : Color.Gray; diff --git a/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs b/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs index ef5289b..696d67b 100644 --- a/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs +++ b/CleanMachineHMI/FrmUserControl/frmOperatorReport.Designer.cs @@ -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; } } diff --git a/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs b/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs index 4af693e..1b3f35f 100644 --- a/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs +++ b/CleanMachineHMI/FrmUserControl/frmOperatorReport.cs @@ -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(); + } } } diff --git a/CleanMachineHMI/FrmUserControl/frmOperatorReport.resx b/CleanMachineHMI/FrmUserControl/frmOperatorReport.resx index eac2cd8..1d87e8f 100644 --- a/CleanMachineHMI/FrmUserControl/frmOperatorReport.resx +++ b/CleanMachineHMI/FrmUserControl/frmOperatorReport.resx @@ -129,4 +129,16 @@ True + + True + + + True + + + True + + + True + \ No newline at end of file diff --git a/CleanMachineHMI/ReportMd/operatorReport.frx b/CleanMachineHMI/ReportMd/operatorReport.frx new file mode 100644 index 0000000..21d363a --- /dev/null +++ b/CleanMachineHMI/ReportMd/operatorReport.frx @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +