public void MakeReport(DLJoinView jview, CalendarMonthInfo calmt, string title, ERoportType roporttype, MyStyleDefs mystyldDefs) { HeaderHolyDay = mystyldDefs.HeaderHolyDayBack; HeaderWeekEndDay = mystyldDefs.HeaderWeekEndBack; VacationDay = mystyldDefs.VacationBack; SickDay = mystyldDefs.SickDayBack; FreeDay = mystyldDefs.FreeDayBack; HolyDay = mystyldDefs.HolyDayBack; MakeReportA(jview, calmt); if (ReportRows.Count == 0) { return; } var period = string.Format("{0}. gada {1}", calmt.Year, Utils.MonthNames[calmt.Month - 1]); ReportViewerData rd = new ReportViewerData(); if (roporttype == ERoportType.Simple) { rd.FileName = "ReportA_DarbaLaiks_1"; } else { rd.FileName = "ReportA_DarbaLaiks_1k"; } rd.Sources["DataSet1"] = ReportRows; rd.AddReportParameters(new string[] { "CompanyName", MyData.Params.CompNameX, "RPerson", "", "RPeriod", period, "RLastVisibleDay", calmt.DaysInMonth.ToString(), "RTitle", title, "RRemark", "" }); rd.AddReportParameter("RHeaders", Headers); if (roporttype == ERoportType.WithColors) { rd.AddReportParameter("RHeaderColors", HeaderColors); } MyData.MyMainForm.ShowReport(rd); }
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); }