This commit is contained in:
gongxh
2022-05-30 09:27:46 +08:00
parent 847dffd9f1
commit 2a334e7d75
10 changed files with 334 additions and 12 deletions

View File

@@ -91,6 +91,9 @@
<None Update="ReportMd\CleanMac_IRMsg_PrintMd.frx"> <None Update="ReportMd\CleanMac_IRMsg_PrintMd.frx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>
<None Update="ReportMd\dayReport.frx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="ReportMd\operatorReport.frx"> <None Update="ReportMd\operatorReport.frx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None> </None>

View File

@@ -49,6 +49,7 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker(); this.kdtp_CreateStartTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel(); this.kryptonLabel5 = new Krypton.Toolkit.KryptonLabel();
this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker(); this.kdtp_CreateEndTime = new Krypton.Toolkit.KryptonDateTimePicker();
this.kryptonButton1 = new Krypton.Toolkit.KryptonButton();
((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonPanel2)).BeginInit();
this.kryptonPanel2.SuspendLayout(); this.kryptonPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.kryptonGroupBox3)).BeginInit();
@@ -218,6 +219,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.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.Percent, 33.33112F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); 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_Reset, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.kbt_Query, 1, 0); this.tableLayoutPanel2.Controls.Add(this.kbt_Query, 1, 0);
this.tableLayoutPanel2.Location = new System.Drawing.Point(727, 48); this.tableLayoutPanel2.Location = new System.Drawing.Point(727, 48);
@@ -314,6 +316,19 @@ namespace CleanMachineHMI.FrmUserControl
this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21); this.kdtp_CreateEndTime.Size = new System.Drawing.Size(246, 21);
this.kdtp_CreateEndTime.TabIndex = 7; this.kdtp_CreateEndTime.TabIndex = 7;
// //
// kryptonButton1
//
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 = 2;
this.kryptonButton1.Tag = "show";
this.kryptonButton1.Values.Text = "打印";
this.kryptonButton1.Click += new System.EventHandler(this.kryptonButton1_Click);
//
// frmDayReport // frmDayReport
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -363,5 +378,6 @@ namespace CleanMachineHMI.FrmUserControl
private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime; private System.Windows.Forms.DataGridViewTextBoxColumn ColStartTime;
private System.Windows.Forms.DataGridViewTextBoxColumn ColEndTime; private System.Windows.Forms.DataGridViewTextBoxColumn ColEndTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colOperators; private System.Windows.Forms.DataGridViewTextBoxColumn colOperators;
private Krypton.Toolkit.KryptonButton kryptonButton1;
} }
} }

View File

@@ -107,8 +107,25 @@ namespace CleanMachineHMI.FrmUserControl
kdtp_CreateEndTime.Checked = false; kdtp_CreateEndTime.Checked = false;
} }
private void kryptonButton1_Click(object sender, EventArgs e)
{
var print = new frmPring();
try
{
print.Show();
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetReport(this.kdtp_CreateEndTime.Value, this.kdtp_CreateStartTime.Value);
FastReport.Report report = new FastReport.Report();
report.Load("ReportMd\\dayReport.frx");
report.RegisterData(list, "datas");
//report.Design();
report.PrintSettings.ShowDialog = false;
report.Prepare();
report.Print();
}
finally
{
print.Close();
}
}
} }
} }

View File

@@ -2624,7 +2624,20 @@ namespace CleanMachineHMI.FrmUserControl
LeadDbHelperSQLite.Execute(sqlTmp1); LeadDbHelperSQLite.Execute(sqlTmp1);
} }
} }
PrintWorkedIrMsg(ktb_IR.Text);
var print = new frmPring();
try
{
print.Show();
PrintWorkedIrMsg(ktb_IR.Text);
}
finally
{
print.Close();
}
//保存打印数据 //保存打印数据
string sqlInsertZbkWorkingPallet = $@"INSERT INTO ZBK_WORKING_PALLET SELECT * FROM CM_WORKING_PALLET WHERE WORKING_PALLET_CODE in (select WORKING_PALLET_CODE from CM_WORKING_PALLET_DTL where IR_CODE = '{ktb_IR.Text}' and WORKING_DTL_STATUS = 1)"; string sqlInsertZbkWorkingPallet = $@"INSERT INTO ZBK_WORKING_PALLET SELECT * FROM CM_WORKING_PALLET WHERE WORKING_PALLET_CODE in (select WORKING_PALLET_CODE from CM_WORKING_PALLET_DTL where IR_CODE = '{ktb_IR.Text}' and WORKING_DTL_STATUS = 1)";
string sqlInsertZbkWorkingPalletDtl = $@"INSERT INTO ZBK_WORKING_PALLET_DTL SELECT * FROM CM_WORKING_PALLET_DTL WHERE WORKING_DTL_STATUS = 1 and IR_CODE = '{ktb_IR.Text}';"; string sqlInsertZbkWorkingPalletDtl = $@"INSERT INTO ZBK_WORKING_PALLET_DTL SELECT * FROM CM_WORKING_PALLET_DTL WHERE WORKING_DTL_STATUS = 1 and IR_CODE = '{ktb_IR.Text}';";

View File

@@ -108,13 +108,25 @@ namespace CleanMachineHMI.FrmUserControl
private void kryptonButton1_Click(object sender, EventArgs e) private void kryptonButton1_Click(object sender, EventArgs e)
{ {
var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport(this.kdtp_CreateStartTime.Value, this.kdtp_CreateEndTime.Value); var print = new frmPring();
FastReport.Report report = new FastReport.Report(); try
report.Load("ReportMd\\operatorReport.frx"); {
report.RegisterData(list, "datas"); print.Show();
//report.Design(); var list = new CleanMachine.BLL.ZBK.DayReportBLL().GetOPReport(this.kdtp_CreateStartTime.Value, this.kdtp_CreateEndTime.Value);
report.Prepare(); FastReport.Report report = new FastReport.Report();
report.Print(); report.Load("ReportMd\\operatorReport.frx");
report.RegisterData(list, "datas");
//report.Design();
report.PrintSettings.ShowDialog = false;
report.Prepare();
report.Print();
}
finally
{
print.Close();
}
} }
} }
} }

View File

@@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<Report ScriptLanguage="CSharp" ReportInfo.Created="05/17/2022 13:55:09" ReportInfo.Modified="05/17/2022 14:48:54" ReportInfo.CreatorVersion="2014.4.8.0">
<Dictionary>
<BusinessObjectDataSource Name="datas" ReferenceName="datas" DataType="System.Collections.Generic.List`1[[CleanMachine.Model.ZBK.OperatorReport, CleanMachine.Model, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]" Enabled="true">
<Column Name="Date" DataType="System.DateTime"/>
<Column Name="Cleaned" DataType="System.Int32"/>
<Column Name="Scrap" DataType="System.Int32"/>
<Column Name="DayOfWeek" DataType="System.DayOfWeek"/>
<Column Name="StartTime" DataType="System.DateTime"/>
<Column Name="EndTime" DataType="System.DateTime"/>
<Column Name="MachineHours" DataType="System.Single"/>
</BusinessObjectDataSource>
</Dictionary>
<ReportPage Name="Page1">
<ReportTitleBand Name="ReportTitle1" Width="718.2" Height="37.8"/>
<PageHeaderBand Name="PageHeader1" Top="39.8" Width="718.2" Height="18.9">
<TextObject Name="Text2" Left="37.8" Width="94.5" Height="18.9" Text="Date" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text4" Left="132.3" Width="94.5" Height="18.9" Text="DayOfWeek" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text6" Left="226.8" Width="94.5" Height="18.9" Text="Cleaned" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text8" Left="321.3" Width="47.25" Height="18.9" Text="Scrap" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text10" Left="368.55" Width="66.15" Height="18.9" Text="StartTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text12" Left="434.7" Width="56.7" Height="18.9" Text="EndTime" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text14" Left="491.4" Width="94.5" Height="18.9" Text="MachineHours" VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<TextObject Name="Text18" Width="37.8" Height="18.9" Text="NO." VertAlign="Center" Font="宋体, 9pt, style=Bold"/>
<LineObject Name="Line1" Top="18.9" Width="680.4" Diagonal="true"/>
</PageHeaderBand>
<DataBand Name="Data1" Top="60.7" Width="718.2" Height="18.9" CanGrow="true" DataSource="datas" KeepTogether="true">
<TextObject Name="Text1" Left="37.8" Width="94.5" Height="18.9" Text="[datas.Date]" Format="Date" Format.Format="d" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text3" Left="132.3" Width="94.5" Height="18.9" Text="[datas.DayOfWeek]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text5" Left="226.8" Width="94.5" Height="18.9" Text="[datas.Cleaned]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text7" Left="321.3" Width="47.25" Height="18.9" Text="[datas.Scrap]" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text9" Left="368.55" Width="66.15" Height="18.9" Text="[datas.StartTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text11" Left="434.7" Width="56.7" Height="18.9" Text="[datas.EndTime]" Format="Time" Format.Format="t" VertAlign="Center" Font="宋体, 9pt"/>
<TextObject Name="Text13" Left="491.4" Width="94.5" Height="18.9" Text="[datas.MachineHours]" Format="Number" Format.UseLocale="true" HorzAlign="Right" VertAlign="Center" WordWrap="false" Font="宋体, 9pt" Trimming="EllipsisCharacter"/>
<TextObject Name="Text17" Width="37.8" Height="18.9" Text="[Row#]" VertAlign="Center" Font="宋体, 9pt"/>
<Sort>
<Sort Expression="[datas.Date]"/>
<Sort Expression="[datas.Operator]"/>
</Sort>
</DataBand>
<PageFooterBand Name="PageFooter1" Top="81.6" Width="718.2" Height="94.5">
<TextObject Name="Text19" Left="585.9" Width="94.5" Height="18.9" Text="[PageN]/[TotalPages#]" Font="宋体, 9pt"/>
<LineObject Name="Line2" Width="680.4" Diagonal="true"/>
<TextObject Name="Text20" Left="226.8" Width="94.5" Height="18.9" Font="宋体, 9pt"/>
<TextObject Name="Text21" Left="28.35" Top="18.9" Width="132.3" Height="18.9" Text="sum([datas.scrap])" Font="宋体, 9pt"/>
</PageFooterBand>
</ReportPage>
</Report>

View File

@@ -1195,7 +1195,7 @@ namespace CleanMachineHMI
try try
{ {
#endif #endif
if (!this.IsConn) return false; // if (!this.IsConn) return false;
switch (itemType) switch (itemType)
{ {
case PlcItemTypeDesc.M: case PlcItemTypeDesc.M:

69
CleanMachineHMI/frmPring.Designer.cs generated Normal file
View File

@@ -0,0 +1,69 @@
namespace CleanMachineHMI
{
partial class frmPring
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.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.label1.AutoSize = true;
this.label1.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.label1.Location = new System.Drawing.Point(99, 29);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(154, 24);
this.label1.TabIndex = 0;
this.label1.Text = "printing ...";
//
// frmPring
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(355, 91);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmPring";
this.ShowIcon = false;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "frmPring";
this.TopMost = true;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
}
}

View File

@@ -0,0 +1,21 @@
using Krypton.Toolkit;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace CleanMachineHMI
{
public partial class frmPring : KryptonForm
{
public frmPring()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>