private void DoIt() { string rt = Check(); if (rt != "OK") { MyMainForm.ShowWarning(rt); return; } int cmid = lbCM.SelectedIndex; if (cmid == -1) { return; } SaveParams(); TRepMTTableAdapter ad = MyData.GetKlonsRepAdapter("TRepMT") as TRepMTTableAdapter; if (ad == null) { return; } ReportViewerData rd = new ReportViewerData(); switch (cmid) { case 0: ad.FillBy_apgr_mt_11(MyData.DataSetKlonsRep.TRepMT, startDate, endDate, ac); break; case 1: case 2: ad.FillBy_apgr_mt_12(MyData.DataSetKlonsRep.TRepMT, startDate, endDate, ac); break; case 3: ad.FillBy_apgr_mt_21(MyData.DataSetKlonsRep.TRepMT, startDate, endDate, ac); break; case 4: ad.FillBy_apgr_mt_22(MyData.DataSetKlonsRep.TRepMT, startDate, endDate, ac); break; } MyData.ReportHelper.PrepareTRepMT(); switch (cmid) { case 0: rd.FileName = "Report_Apgr_MT_11"; break; case 1: rd.FileName = "Report_Apgr_MT_12"; break; case 2: rd.FileName = "Report_Apgr_MT_13"; break; case 3: case 4: rd.FileName = "Report_Apgr_MT_21"; break; } rd.Sources["DataSet1"] = MyData.DataSetKlonsRep.TRepMT; rd.AddReportParameters( new string[] { "RSD", MyData.Params.RSD, "RED", MyData.Params.RED, "RACX", MyData.Params.RACX, "RACNM", MyData.Params.RACNM, "CompanyName", MyData.Params.CompNameX }); switch (cmid) { case 3: rd.AddReportParameter("RTITLE", "Apgrozijuma pārskats debetam ar summām un daudzumiem"); break; case 4: rd.AddReportParameter("RTITLE", "Apgrozijuma pārskats kredītam ar summām un daudzumiem"); break; } MyMainForm.ShowReport(rd); }
private void DoIt() { string rt = Check(); if (rt != "OK") { MyMainForm.ShowWarning(rt); return; } int selectedReport = lbCM.SelectedIndex; if (selectedReport == -1) { return; } TRepMTTableAdapter ad1 = MyData.GetKlonsRepAdapter("TRepMT") as TRepMTTableAdapter; if (ad1 == null) { return; } string speriod = string.Format("{0}. gada jan.-{1}.", startDate.Year, Utils.MonthNames[endDate.Month - 1].LeftMax(3)); SaveParams(); ReportViewerData rd = new ReportViewerData(); switch (selectedReport) { case 0: ad1.FillBy_npmt_14(MyData.DataSetKlonsRep.TRepMT, startDate, endDate); MyData.ReportHelper.PrepareTRepMTForNPMT1(endDate.Month); rd.FileName = "Report_NPMT_1"; break; case 1: ad1.FillBy_npmt_24(MyData.DataSetKlonsRep.TRepMT, startDate, endDate); MyData.ReportHelper.PrepareTRepMTForNPMT1(endDate.Month); rd.FileName = "Report_NPMT_2"; break; case 2: ad1.FillBy_npmt_44(MyData.DataSetKlonsRep.TRepMT, startDate, endDate); MyData.ReportHelper.PrepareTRepMTForNPMT1(endDate.Month); rd.FileName = "Report_NPMT_1"; break; case 3: ad1.FillBy_npmt_31(MyData.DataSetKlonsRep.TRepMT, startDate, endDate); MyData.ReportHelper.PrepareTRepMTForNPMT3(); rd.FileName = "Report_NPMT_3"; break; } rd.Sources["DataSet1"] = MyData.DataSetKlonsRep.TRepMT; rd.AddReportParameters( new string[] { "RPERIOD", speriod, "CompanyName", MyData.Params.CompNameX }); MyMainForm.ShowReport(rd); }