private void обороткаToolStripMenuItem2_Click(object sender, EventArgs e) { Stimulsoft.Report.StiConfig.LoadLocalization("ru.xml"); StiReport report = new StiReport(); StiOptions.Dictionary.BusinessObjects.MaxLevel = 0; report.Load(Path.Combine(Application.StartupPath, "Reports\\oborotka.mrt")); var opers = new AllOperationRepository().GetAllOperation(BeginDate, EndDate).ToList(); report.RegData("Operations", opers); report.Dictionary.Variables.Add("BeginDate", BeginDate); report.Dictionary.Variables.Add("EndDate", EndDate); var saldolist = new AllOperationRepository().GetAllOperation(BeginDate, EndDate).ToList(); decimal saldodebet, saldokredit; if (saldolist != null) { saldodebet = saldolist.Sum(c => c.SummaDebet); saldokredit = saldolist.Sum(c => c.SummaKredit); } else saldodebet = saldokredit = 0M; report.Dictionary.Variables.Add("SaldoDebet", saldodebet); report.Dictionary.Variables.Add("SaldoKredit", saldokredit); //report.ReportName = String.Format("Накладная №{0} от {1:dd-MM-yyyy}", order.Invoice.Num, order.Invoice.Data); //report.Design(); report.Show(true); }
private void книгаУчетаДоходовИРасходовToolStripMenuItem_Click(object sender, EventArgs e) { StiConfig.LoadLocalization("ru.xml"); var report = new StiReport(); StiOptions.Dictionary.BusinessObjects.MaxLevel = 0; report.Load(Path.Combine(Application.StartupPath, "Reports\\kniga.mrt")); var opers = new AllOperationRepository().GetAllOperation(BeginDate, EndDate).ToList(); report.RegData("Operations", opers); var allopers = new AllOperationRepository().GetAllOperation(new DateTime(Year, 1, 1, 0, 0, 0), EndDate).ToList(); int count = new AllOperationRepository().GetAllOperation(new DateTime(Year, 1, 1, 0, 0, 0), BeginDate.AddSeconds(-1)).Count(); report.Dictionary.Variables.Add("BeginDate", BeginDate); report.Dictionary.Variables.Add("EndDate", EndDate); report.Dictionary.Variables.Add("StrPeriod", _strperiod); report.Dictionary.Variables.Add("StrDate", _strdate); report.Dictionary.Variables.Add("CountPosition", count); report.Dictionary.Variables.Add("SummaTotalPrihod", allopers.Sum(c=>c.SummaDebet)); report.Dictionary.Variables.Add("SummoTotalRashod", allopers.Sum(c=>c.SummaKredit)); if (ApplicationDeployment.IsNetworkDeployed) { report.Show(true); } else { report.Design(); } }