public ActionResult ReceiveReportViewerExportTo(ReceiptsViewModel receiptsViewModel) { //Cats.Web.Hub.Reports.MasterReportBound rep = GetReceiveReport(receiptsViewModel); Cats.Web.Hub.Reports.MasterReportBound rep = GetReceiveReportByBudgetYear(receiptsViewModel); //TODO:Install DevexpressV11 return DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep); return(View()); }
public static MasterReportBound GetFreeStockReport(Cats.Models.Hub.ViewModels.Report.Data.FreeStockReport freestockreport) { var rpt = new Cats.Web.Hub.Reports.FreeStockReport(); rpt.DataSource = freestockreport.Programs; var report = new MasterReportBound(); //report.DataSource = freestockreport.Programs ; report.rptSubReport.ReportSource = rpt; return report; }
public static MasterReportBound GetOffloadingReport(Cats.Models.Hub.ViewModels.Report.Data.OffloadingReport offloadingreport) { var rpt = new OffLoadingReport(); rpt.DataSource = offloadingreport; MasterReportBound report = new MasterReportBound(); report.DataSource = offloadingreport; report.rptSubReport.ReportSource = rpt; return report; }
public static MasterReportBound GetContainerReport(Cats.Models.Hub.ViewModels.Report.Data.BaseReport baseReportType) { MasterReportBound report = new MasterReportBound(); report.DataSource = baseReportType; return report; }
public MasterReportBound GetReceiveReportByBudgetYear(ReceiptsViewModel receiptsViewModel) { List<Cats.Models.Hub.ViewModels.Report.Data.ReceiveReportMain> reports = new List<ReceiveReportMain>(); Cats.Models.Hub.ViewModels.Report.Data.ReceiveReportMain receivereport = new ReceiveReportMain(); UserProfile user = _userProfileService.GetUser(User.Identity.Name); receivereport.receiveReports = _transactionService.GetReceiveReport(user.DefaultHub.HubID, receiptsViewModel);//new List<ViewModels.Report.Data.ReceiveReport>(); receivereport.PreparedBy = user.GetFullName(); receivereport.HubName = user.DefaultHub.HubNameWithOwner; receivereport.ReportDate = System.DateTime.Now; receivereport.ReportCode = DateTime.Now.ToString(); receivereport.ReportName = "ReceiveReport"; receivereport.ReportTitle = "Receive Report"; reports.Add(receivereport); Cats.Web.Hub.Reports.ReceiveReportByBudgetYear rpt = new ReceiveReportByBudgetYear() { DataSource = receivereport.receiveReports }; MasterReportBound report = new MasterReportBound() { Name = "Receive Report - " + DateTime.Now.ToShortDateString(), DataSource = reports }; report.rptSubReport.ReportSource = rpt; return report; }
public MasterReportBound GetOffloading(DispatchesViewModel dispatchesViewModel) { UserProfile user = _userProfileService.GetUser(User.Identity.Name); OffloadingReportMain main = new OffloadingReportMain(); List<OffloadingReport> reports = _transactionService.GetOffloadingReport(user.DefaultHub.HubID, dispatchesViewModel); main.reports = reports; main.PreparedBy = user.GetFullName(); main.HubName = user.DefaultHub.HubNameWithOwner; main.ReportDate = DateTime.Now; main.ReportName = "OffloadingReport"; main.ReportTitle = "Offloading"; List<OffloadingReportMain> coll = new List<OffloadingReportMain>(); coll.Add(main); OffLoadingReport rpt = new OffLoadingReport() { DataSource = reports }; // XtraReport1 rpt = new XtraReport1() { DataSource = freestockreport.Programs[2].Details }; MasterReportBound report = new MasterReportBound() { Name = "Offloading Report " + DateTime.Now.ToShortDateString(), DataSource = coll }; report.rptSubReport.ReportSource = rpt; return report; }
public MasterReportBound GetFreeStock(FreeStockFilterViewModel freeStockFilterViewModel) { List<Cats.Models.Hub.ViewModels.Report.Data.FreeStockReport> reports = new List<Cats.Models.Hub.ViewModels.Report.Data.FreeStockReport>(); Cats.Models.Hub.ViewModels.Report.Data.FreeStockReport freestockreport = new Cats.Models.Hub.ViewModels.Report.Data.FreeStockReport(); UserProfile user =_userProfileService.GetUser(User.Identity.Name); freestockreport.Programs = _hubService.GetFreeStockGroupedByProgram(user.DefaultHub.HubID, freeStockFilterViewModel); freestockreport.PreparedBy = user.GetFullName(); freestockreport.HubName = user.DefaultHub.HubNameWithOwner; freestockreport.ReportDate = System.DateTime.Now; freestockreport.ReportName = "FreeStockStatusReport"; freestockreport.ReportTitle = "Free Stock Status"; reports.Add(freestockreport); Cats.Web.Hub.Reports.FreeStockReport rpt = new Cats.Web.Hub.Reports.FreeStockReport() { DataSource = freestockreport.Programs }; // XtraReport1 rpt = new XtraReport1() { DataSource = freestockreport.Programs[2].Details }; MasterReportBound report = new MasterReportBound() { DataSource = reports }; report.rptSubReport.ReportSource = rpt; return report; }
public MasterReportBound GetDonationReport() { var reports = new List<DeliveryReport>(); var donation = new DeliveryReport(); UserProfile user = _userProfileService.GetUser(User.Identity.Name); donation.PreparedBy = user.GetFullName(); donation.ReportCode = DateTime.Now.ToString(); donation.ReportDate = DateTime.Now; donation.ReportName = "DistributionReport"; donation.ReportTitle = "Distribution Report"; Random ran = new Random(1); donation.Rows = new List<DeliveryRows>(); for (int i = 1; i < 200; i++) { DeliveryRows r = new DeliveryRows(); r.SINumber = "00001283"; r.Hub = donation.HubName; r.DeliveryOrderNumber = i.ToString().PadLeft(8, '0'); r.HubOwner = "DRMFSS"; r.PortName = "Djibuti"; r.ShippedBy = "WFP"; r.Vessel = "Liberty Sun"; r.Project = "DRMFSS 4765"; r.Commodity = "Cereal"; r.SubCommodity = "Wheat"; r.WareHouseNumber = i / 50 + 1; r.Unit = "mt"; r.DeliveryBag = 99 * i * decimal.Parse("12"); r.DeliveryQuantity = 67 * i * decimal.Parse("34.89"); r.DeliveryNet = 23 * i * decimal.Parse("81"); r.Donor = "US Aid"; r.DeliveryType = "Donation"; r.DeliveryReferenceNumber = i.ToString().PadLeft(8, '0'); r.Date = DateTime.Now.ToShortDateString(); r.TransportedBy = ((i % 3 == 0) ? " DRMFSS " : "Another Trasporter"); r.VehiclePlateNumber = "03-A0012" + (i / 24).ToString(); donation.Rows.Add(r); } reports.Add(donation); Cats.Web.Hub.Reports.DonationReportByProgram rpt = new Web.Hub.Reports.DonationReportByProgram() { DataSource = reports[0].Rows }; MasterReportBound report = new MasterReportBound() { Name = "Donation 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; }
public ActionResult OffloadingReportViewerExportTo(DispatchesViewModel dispatchesViewModel) { Cats.Web.Hub.Reports.MasterReportBound rep = GetOffloading(dispatchesViewModel); //TODO:Install DevexpressV11 return DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep); return(View()); }