private void toolStripMenuItem_RowIssueStatSecond_Click(object sender, EventArgs e) { if (myEventArgs_ShipClassification.bool_GXTheory) { return; } string str_Subhead; Form_InputBox myForm_InputBox = new Form_InputBox(); myForm_InputBox.str_Title = "报表副标题输入"; myForm_InputBox.str_Prompt = "请输入报表的副标题:"; if (myForm_InputBox.ShowDialog() == DialogResult.OK) { str_Subhead = myForm_InputBox.str_DefaultResponse; } else { return; } StringBuilder str_IssueStat = new StringBuilder(); str_IssueStat.Append("select t4.WeldingClass, t4.WeldingClassCount, t5.* from dbo.Exam_Issue as t5 left join"); str_IssueStat.Append(" (select t1.issueno, t3.WeldingClass, count(t3.WeldingClass) as WeldingClassCount from dbo.Exam_Issue as t1 inner join dbo.Exam_Student as t2 on t1.issueno=t2.issueno"); str_IssueStat.Append(" inner join dbo.Parameter_WeldingSubject as t3 on t2.ExamSubjectID = t3.SubjectID"); str_IssueStat.Append(" where t2.SkillResult=1 or t2.SkillMakeupResult=1"); str_IssueStat.Append(" group by t1.issueno, t3.WeldingClass) as t4 on t5.issueno=t4.issueno"); str_IssueStat.Append(" where "); bool b_Flag = false; foreach (DataRow myDataRow in this.myDataTable.Rows) { if (b_Flag) { str_IssueStat.Append(" Or "); } else { b_Flag = true; } str_IssueStat.Append(string.Format(" t5.IssueNo = '{0}'", myDataRow["IssueNo"].ToString())); } ReportDataSource[] myReportDataSourceRange = new ReportDataSource[2]; myReportDataSourceRange[0] = new ReportDataSource("DataSet_IssueStat", Class_zwjPublic.myClass_SqlConnection.GetDataTable(str_IssueStat.ToString())); myReportDataSourceRange[1] = new ReportDataSource("DataSet_IssueStatSecond", this.myDataView); ReportParameter myReportParameter_Subhead = new ReportParameter("Report_Parameter_Subhead", str_Subhead); ReportParameter[] myReportParameterRange = new ReportParameter[] { myReportParameter_Subhead }; Form_Report myForm = new Form_Report(); myForm.InitReport("ZCWelder.Reports.焊工考试班级统计汇总表.rdlc", myReportDataSourceRange, myReportParameterRange); myForm.ShowDialog(); }
private void itemTelefonliste_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; var r = ReportManager.GetReportByName(EReports.Telefonliste); var report = new Form_Report(r); report.Show(); report.Refresh(); this.Cursor = Cursors.Default; }
private void vorschauToolStripMenuItem_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; var report = ReportManager.GetReportByNameForSelectedRecord(EReports.Rechnung, new List<int>() { 1, int.Parse(tbxRechNummer.Text) }); var r = new Form_Report(report); r.Show(); r.Refresh(); this.Cursor = Cursors.Default; }
private void AngebotVorschauToolStripMenuItem_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; List<int> posIDs = new List<int>(); foreach (DataGridViewRow row in dgrPositionen.Rows) { // Nur alle gecheckten Positionen berücksichtigen. var cell = row.Cells[Const.CheckColumHeaderName] as DataGridViewCheckBoxCell; if (cell.Value != null && (bool)cell.Value == true) { Angebot_Position pos = row.DataBoundItem as Angebot_Position; if (pos != null) { posIDs.Add(pos.PosID); } } } ReportDocument report; if (posIDs.Count == 0) { report = ReportManager.GetReportByNameForSelectedRecord(EReports.Angebot, new List<int>() { 1, int.Parse(tbxAngNummer.Text) }, new List<int>() { 1, 0 }); } else { report = ReportManager.GetReportByNameForSelectedRecord(EReports.Angebot, new List<int>() { 1, int.Parse(tbxAngNummer.Text) }, posIDs); } var r = new Form_Report(report); r.Show(); r.Refresh(); posIDs = null; this.Cursor = Cursors.Default; }
/// <summary> /// Öffnet den gewählten Bericht in der Vorschau-ANzeige. /// </summary> private void PrintVorschau() { this.Cursor = Cursors.WaitCursor; Form_Report r; List<int> data = new List<int>(); switch (module) { case "Angebote": { foreach (DataGridViewRow row in dgrResults.Rows) { DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell; if (cell.Value != null) { data.Add((int)row.Cells["AngebotID"].Value); } } //data.Add((int)row.Cells[0].Value); var report = ReportManager.GetReportByNameForSelectedRecord(EReports.Angebot, data); r = new Form_Report(report); r.Show(); r.Refresh(); } break; case "Aufträge": { foreach (DataGridViewRow row in dgrResults.Rows) { DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell; if (cell.Value != null) { data.Add((int)row.Cells["AuftragID"].Value); } } //data.Add((int)row.Cells[0].Value); var report = ReportManager.GetReportByNameForSelectedRecord(EReports.Auftragsbestätigung, data); r = new Form_Report(report); r.Show(); r.Refresh(); } break; case "Rechnungen": { foreach (DataGridViewRow row in dgrResults.Rows) { DataGridViewCheckBoxCell cell = row.Cells[0] as DataGridViewCheckBoxCell; if (cell.Value != null) { data.Add((int)row.Cells["RechnungID"].Value); } } //data.Add((int)row.Cells[0].Value); var report = ReportManager.GetReportByNameForSelectedRecord(EReports.Rechnung, data); r = new Form_Report(report); r.Show(); r.Refresh(); } break; } this.Cursor = Cursors.Default; }