private void toolStripMenuItem_RowExportCrystalReport_Click(object sender, EventArgs e) { this.dataGridView_Data.CurrentCell = null; DataView myDataView_Temp = new DataView(this.myDataTable_Modified); myDataView_Temp.RowFilter = "Checked=True"; if (myDataView_Temp.Count == 0) { MessageBox.Show("请选择数据!"); return; } Form_ReportSelect myForm = new Form_ReportSelect(); myForm.myClass_Report = new Class_Report(); myForm.myClass_Report.ReportGroup = "学员二"; if (myForm.ShowDialog() == DialogResult.OK) { Form_CrystalReport myForm_Report = new Form_CrystalReport(); System.Collections.ArrayList myArrayList = new System.Collections.ArrayList(); foreach (DataRowView myDataRowView in myDataView_Temp) { myArrayList.Add(myDataRowView["ExaminingNo"].ToString()); } string str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), myForm.myClass_Report.ReportLocation); myForm_Report.InitCrystalReport(str_FileName, "ExaminingNo", myArrayList, null, myForm.str_Subhead); myForm_Report.ShowDialog(); } }
private void toolStripMenuItem_RowExportReport_Click(object sender, EventArgs e) { Form_ReportSelect myForm = new Form_ReportSelect(); myForm.myClass_Report = new Class_Report(); myForm.myClass_Report.ReportGroup = "在册焊工持证信息"; if (myForm.ShowDialog() == DialogResult.OK) { Form_CrystalReport myForm_Report = new Form_CrystalReport(); string str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), myForm.myClass_Report.ReportLocation); Class_Data myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WelderBelongQC.ToString()]; myClass_Data.SetFilter(this.str_Filter); myClass_Data.RefreshData(false); myForm_Report.InitCrystalReport(str_FileName, null, null, myClass_Data.myDataView, null); myForm_Report.ShowDialog(); } }
private void toolStripMenuItem_RowExportEmployerStat_Click(object sender, EventArgs e) { Form_ReportSelect myForm = new Form_ReportSelect(); myForm.myClass_Report = new Class_Report(); myForm.myClass_Report.ReportGroup = "在册焊工持证信息"; if (myForm.ShowDialog() == DialogResult.OK) { Form_CrystalReport myForm_Report = new Form_CrystalReport(); string str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), myForm.myClass_Report.ReportLocation); //string str_Subhead = string.Format("{0} : {1}", this.GetstrUnit() , this.GetstrShipClassification() ); string str_Subhead = string.Format("{0}", this.GetstrShipClassification()); //myForm_Report.str_Parameter_Field_Name = "IssueNo"; //myForm_Report.myArrayList = new System.Collections.ArrayList(); //myForm_Report.myArrayList.Add(this.myEventArgs_Issue.str_IssueNo); myForm_Report.InitCrystalReport(str_FileName, null, null, this.myDataView, str_Subhead); myForm_Report.ShowDialog(); } }
private void toolStripMenuItem_RowExportCrystalReport_Click(object sender, EventArgs e) { Form_ReportSelect myForm = new Form_ReportSelect(); myForm.myClass_Report = new Class_Report(); myForm.myClass_Report.ReportGroup = "启用证书"; if (myForm.ShowDialog() == DialogResult.OK) { Form_CrystalReport myForm_Report = new Form_CrystalReport(); System.Collections.ArrayList myArrayList = new System.Collections.ArrayList(); foreach (DataGridViewRow myDataGridViewRow in this.dataGridView_Data.Rows) { myArrayList.Add(myDataGridViewRow.Cells ["ExaminingNo"].Value.ToString()); } string str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), myForm.myClass_Report.ReportLocation); myForm_Report.InitCrystalReport(str_FileName, "ExaminingNo", myArrayList, null, myForm.str_Subhead); myForm_Report.ShowDialog(); } }
private void toolStripMenuItem_DataGridViewRowExportToIssueArchive_Click(object sender, EventArgs e) { if (this.myEventArgs_Issue.bool_GXTheory) { Form_CrystalReport myForm_Report = new Form_CrystalReport(); System.Collections.ArrayList myArrayList = new System.Collections.ArrayList(); myArrayList.Add(this.myEventArgs_Issue.str_IssueNo); string str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "GXTheoryIssueArchive档案袋_大.rpt"); myForm_Report.InitCrystalReport(str_FileName, "IssueNo", myArrayList, null, null); myForm_Report.ShowDialog(); } else { Form_CrystalReport myForm_Report = new Form_CrystalReport(); System.Collections.ArrayList myArrayList = new System.Collections.ArrayList(); myArrayList.Add(this.myEventArgs_Issue.str_IssueNo); string str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "IssueArchive档案袋_大.rpt"); myForm_Report.InitCrystalReport(str_FileName, "IssueNo", myArrayList, null, null); myForm_Report.ShowDialog(); } }
private void toolStripMenuItem_RowStatisticWelderQC_Click(object sender, EventArgs e) { DataView myDataView_Temp; DataTable myDataTable_Temp = new DataTable(); Class_Data myClass_Data; string str_Unit = "统计单位:"; Form_ReportSelect myForm = new Form_ReportSelect(); myForm.myClass_Report = new Class_Report(); myForm.myClass_Report.ReportGroup = "在册焊工持证统计"; Form_CrystalReport myForm_Report = new Form_CrystalReport(); string str_FileName; if (myForm.ShowDialog() == DialogResult.OK) { str_FileName = string.Format("{0}\\CrystalReports\\{1}", System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), myForm.myClass_Report.ReportLocation); //myForm_Report.myDataView = this.myDataView; //myForm_Report.ShowDialog(); } else { return; } if (string.IsNullOrEmpty(this.myEventArgs_Unit.WorkPlaceHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.DepartmentHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.EmployerHPID)) { if (string.IsNullOrEmpty(this.myEventArgs_Unit.EmployerGroup)) { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Employer.ToString()]; myClass_Data.RefreshData(false, myDataTable_Temp); myDataView_Temp = new DataView(myDataTable_Temp); foreach (DataRowView myDataRowView in myDataView_Temp) { Class_Employer.StatisticWelderQC(myDataRowView["EmployerHPID"].ToString(), null, null); } myClass_Data.RefreshData(true, myDataTable_Temp); myDataTable_Temp = myDataView_Temp.ToTable(); str_Unit = "统计单位:全部公司"; } else { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Employer.ToString()]; myClass_Data.RefreshData(false, myDataTable_Temp); myDataView_Temp = new DataView(myDataTable_Temp); myDataView_Temp.RowFilter = string.Format("EmployerGroup='{0}'", this.myEventArgs_Unit.EmployerGroup); foreach (DataRowView myDataRowView in myDataView_Temp) { Class_Employer.StatisticWelderQC(myDataRowView["EmployerHPID"].ToString(), null, null); } myClass_Data.RefreshData(true, myDataTable_Temp); myDataTable_Temp = myDataView_Temp.ToTable(); str_Unit = string.Format("统计单位:{0}", this.myEventArgs_Unit.EmployerGroup); } } else { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.Department.ToString()]; myClass_Data.RefreshData(false, myDataTable_Temp); myDataView_Temp = new DataView(myDataTable_Temp); myDataView_Temp.RowFilter = string.Format("EmployerHPID='{0}'", this.myEventArgs_Unit.EmployerHPID); foreach (DataRowView myDataRowView in myDataView_Temp) { Class_Department.StatisticWelderQC(myDataRowView["DepartmentHPID"].ToString(), null, null); } Class_Employer myClass_Employer = new Class_Employer(this.myEventArgs_Unit.EmployerHPID); myClass_Data.RefreshData(true, myDataTable_Temp); myDataTable_Temp = myDataView_Temp.ToTable(); myDataTable_Temp.Columns.Remove("Employer"); myDataTable_Temp.Columns["Department"].ColumnName = "Employer"; str_Unit = string.Format("统计单位:{0}", myClass_Employer.Employer); } } else { myClass_Data = (Class_Data)Class_Public.myHashtable[Enum_DataTable.WorkPlace.ToString()]; myClass_Data.RefreshData(false, myDataTable_Temp); myDataView_Temp = new DataView(myDataTable_Temp); myDataView_Temp.RowFilter = string.Format("DepartmentHPID='{0}'", this.myEventArgs_Unit.DepartmentHPID); foreach (DataRowView myDataRowView in myDataView_Temp) { Class_WorkPlace.StatisticWelderQC(myDataRowView["WorkPlaceHPID"].ToString(), null, null); } Class_Department myClass_Department = new Class_Department(this.myEventArgs_Unit.DepartmentHPID); Class_Employer myClass_Employer = new Class_Employer(myClass_Department.EmployerHPID); myClass_Data.RefreshData(true, myDataTable_Temp); myDataTable_Temp = myDataView_Temp.ToTable(); myDataTable_Temp.Columns.Remove("Employer"); myDataTable_Temp.Columns["WorkPlace"].ColumnName = "Employer"; str_Unit = string.Format("统计单位:{0} -> {1}", myClass_Employer.Employer, myClass_Department.Department); } } else { return; } myForm_Report.InitCrystalReport(str_FileName, null, null, new DataView(myDataTable_Temp), null); CrystalDecisions.CrystalReports.Engine.TextObject myTextbox; myTextbox = (CrystalDecisions.CrystalReports.Engine.TextObject)myForm_Report.myReportDocument.ReportDefinition.ReportObjects["TextFirst"]; myTextbox.Text = str_Unit; myTextbox = (CrystalDecisions.CrystalReports.Engine.TextObject)myForm_Report.myReportDocument.ReportDefinition.ReportObjects["TextSecond"]; myTextbox.Text = string.Format("统计级别:全部"); myForm_Report.ShowDialog(); }