public MasterReportBound GetDistributionReportPivot(DistributionViewModel distributionViewModel) { List <Cats.Models.Hub.ViewModels.Report.Data.DistributionReport> reports = new List <Cats.Models.Hub.ViewModels.Report.Data.DistributionReport>(); Cats.Models.Hub.ViewModels.Report.Data.DistributionReport distribution = new Cats.Models.Hub.ViewModels.Report.Data.DistributionReport(); UserProfile user = _userProfileService.GetUser(User.Identity.Name); distribution.PreparedBy = user.GetFullName(); distribution.HubName = user.DefaultHub.HubNameWithOwner; distribution.ReportCode = DateTime.Now.ToString(); distribution.ReportDate = DateTime.Now; distribution.ReportName = "DistributionReport"; distribution.ReportTitle = "Distribution Report"; distribution.Rows = new List <DistributionRows>(); distribution.Rows = _transactionService.GetDistributionReport(user.DefaultHub.HubID, distributionViewModel); // new List<DistributionRows>(); //for (int i = 1; i < 5; i++) //{ // DistributionRows r = new DistributionRows(); // r.BudgetYear = DateTime.Now.Year; // r.Region = (i % 2 == 0) ? "Amhara" : "Benshangul"; // r.Program = "Program " + i.ToString(); // r.DistributedAmount = i * decimal.Parse("2340.43674") * 45; // int month = i; // if (month == 0) // month++; // r.Month = month.ToString(); // r.Quarter = (i % 3 > 0) ? (i / 3) + 1 : i / 3; // distribution.Rows.Add(r); //} reports.Add(distribution); Cats.Web.Hub.Reports.DistributionReportPivot rpt = new Cats.Web.Hub.Reports.DistributionReportPivot(); rpt.xrPivotGrid1.DataSource = reports[0].Rows; MasterReportBound report = new MasterReportBound() { Name = "Distribution Report - " + DateTime.Now.ToShortDateString(), DataSource = reports }; report.rptSubReport.ReportSource = rpt; return(report); }
public MasterReportBound GetDistributionReport() { var reports = new List <Cats.Models.Hub.ViewModels.Report.Data.DistributionReport>(); var distribution = new Cats.Models.Hub.ViewModels.Report.Data.DistributionReport(); UserProfile user = _userProfileService.GetUser(User.Identity.Name); distribution.PreparedBy = user.GetFullName(); distribution.ReportCode = DateTime.Now.ToString(); distribution.ReportDate = DateTime.Now; distribution.ReportName = "DistributionReport"; distribution.ReportTitle = "Distribution Report"; Random ran = new Random(1); distribution.Rows = new List <DistributionRows>(); for (int i = 1; i < 2; i++) { DistributionRows r = new DistributionRows(); r.BudgetYear = DateTime.Now.Year; r.Region = (i % 2 == 0) ? "Amhara" : "Benshangul"; r.Program = "Program " + i.ToString(); r.DistributedAmount = i * decimal.Parse("2340.43674") * 45; int month = ran.Next(4); r.Quarter = 1; distribution.Rows.Add(r); } reports.Add(distribution); Cats.Web.Hub.Reports.DistributionReport rpt = new Cats.Web.Hub.Reports.DistributionReport() { DataSource = reports[0].Rows }; MasterReportBound report = new MasterReportBound() { Name = "Distribution Report - " + DateTime.Now.ToShortDateString(), DataSource = reports }; report.rptSubReport.ReportSource = rpt; return(report); }
public MasterReportBound GetDistributionReportPivot(DistributionViewModel distributionViewModel) { List<Cats.Models.Hub.ViewModels.Report.Data.DistributionReport> reports = new List<Cats.Models.Hub.ViewModels.Report.Data.DistributionReport>(); Cats.Models.Hub.ViewModels.Report.Data.DistributionReport distribution = new Cats.Models.Hub.ViewModels.Report.Data.DistributionReport(); UserProfile user = _userProfileService.GetUser(User.Identity.Name); distribution.PreparedBy = user.GetFullName(); distribution.HubName = user.DefaultHub.HubNameWithOwner; distribution.ReportCode = DateTime.Now.ToString(); distribution.ReportDate = DateTime.Now; distribution.ReportName = "DistributionReport"; distribution.ReportTitle = "Distribution Report"; distribution.Rows = new List<DistributionRows>(); distribution.Rows = _transactionService.GetDistributionReport(user.DefaultHub.HubID, distributionViewModel); // new List<DistributionRows>(); //for (int i = 1; i < 5; i++) //{ // DistributionRows r = new DistributionRows(); // r.BudgetYear = DateTime.Now.Year; // r.Region = (i % 2 == 0) ? "Amhara" : "Benshangul"; // r.Program = "Program " + i.ToString(); // r.DistributedAmount = i * decimal.Parse("2340.43674") * 45; // int month = i; // if (month == 0) // month++; // r.Month = month.ToString(); // r.Quarter = (i % 3 > 0) ? (i / 3) + 1 : i / 3; // distribution.Rows.Add(r); //} reports.Add(distribution); Cats.Web.Hub.Reports.DistributionReportPivot rpt = new Cats.Web.Hub.Reports.DistributionReportPivot(); rpt.xrPivotGrid1.DataSource = reports[0].Rows; MasterReportBound report = new MasterReportBound() { Name = "Distribution Report - " + DateTime.Now.ToShortDateString(), DataSource = reports }; report.rptSubReport.ReportSource = rpt; return report; }
public MasterReportBound GetDistributionReport() { var reports = new List<Cats.Models.Hub.ViewModels.Report.Data.DistributionReport>(); var distribution = new Cats.Models.Hub.ViewModels.Report.Data.DistributionReport(); UserProfile user = _userProfileService.GetUser(User.Identity.Name); distribution.PreparedBy = user.GetFullName(); distribution.ReportCode = DateTime.Now.ToString(); distribution.ReportDate = DateTime.Now; distribution.ReportName = "DistributionReport"; distribution.ReportTitle = "Distribution Report"; Random ran = new Random(1); distribution.Rows = new List<DistributionRows>(); for (int i = 1; i < 2; i++) { DistributionRows r = new DistributionRows(); r.BudgetYear = DateTime.Now.Year; r.Region = (i % 2 == 0) ? "Amhara" : "Benshangul"; r.Program = "Program " + i.ToString(); r.DistributedAmount = i * decimal.Parse("2340.43674") * 45; int month = ran.Next(4); r.Quarter = 1; distribution.Rows.Add(r); } reports.Add(distribution); Cats.Web.Hub.Reports.DistributionReport rpt = new Cats.Web.Hub.Reports.DistributionReport() { DataSource = reports[0].Rows }; MasterReportBound report = new MasterReportBound() { Name = "Distribution Report - " + DateTime.Now.ToShortDateString(), DataSource = reports }; report.rptSubReport.ReportSource = rpt; return report; }