public MasterReportBound GetReceiveReportByBudgetYear(ReceiptsViewModel receiptsViewModel) { List<DRMFSS.BLL.ViewModels.Report.Data.ReceiveReportMain> reports = new List<ReceiveReportMain>(); DRMFSS.BLL.ViewModels.Report.Data.ReceiveReportMain receivereport = new BLL.ViewModels.Report.Data.ReceiveReportMain(); BLL.UserProfile user = _userProfileService.GetUser(User.Identity.Name); receivereport.receiveReports = _transactionService.GetReceiveReport(user.DefaultHub.HubID, receiptsViewModel);//new List<BLL.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); DRMFSS.Web.Reports.ReceiveReportByBudgetYear rpt = new Web.Reports.ReceiveReportByBudgetYear() { DataSource = receivereport.receiveReports }; MasterReportBound report = new MasterReportBound() { Name = "Receive Report - " + DateTime.Now.ToShortDateString(), DataSource = reports }; report.rptSubReport.ReportSource = rpt; return report; }
public MasterReportBound GetFreeStock(FreeStockFilterViewModel freeStockFilterViewModel) { List<DRMFSS.BLL.ViewModels.Report.Data.FreeStockReport> reports = new List<BLL.ViewModels.Report.Data.FreeStockReport>(); DRMFSS.BLL.ViewModels.Report.Data.FreeStockReport freestockreport = new BLL.ViewModels.Report.Data.FreeStockReport(); BLL.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); DRMFSS.Web.Reports.FreeStockReport rpt = new Web.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 GetOffloading(DispatchesViewModel dispatchesViewModel) { BLL.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 GetDonationReport() { var reports = new List<BLL.ViewModels.Report.Data.DeliveryReport>(); var donation = new BLL.ViewModels.Report.Data.DeliveryReport(); BLL.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); DRMFSS.Web.Reports.DonationReportByProgram rpt = new Web.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<DRMFSS.BLL.ViewModels.Report.Data.DistributionReport> reports = new List<BLL.ViewModels.Report.Data.DistributionReport>(); DRMFSS.BLL.ViewModels.Report.Data.DistributionReport distribution = new BLL.ViewModels.Report.Data.DistributionReport(); BLL.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); DRMFSS.Web.Reports.DistributionReportPivot rpt = new Web.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<BLL.ViewModels.Report.Data.DistributionReport>(); var distribution = new BLL.ViewModels.Report.Data.DistributionReport(); BLL.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); DRMFSS.Web.Reports.DistributionReport rpt = new Web.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 ReceiveReportViewerExportTo(ReceiptsViewModel receiptsViewModel) { //DRMFSS.Web.Reports.MasterReportBound rep = GetReceiveReport(receiptsViewModel); DRMFSS.Web.Reports.MasterReportBound rep = GetReceiveReportByBudgetYear(receiptsViewModel); return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep)); }
public ActionResult OffloadingReportViewerExportTo(DispatchesViewModel dispatchesViewModel) { DRMFSS.Web.Reports.MasterReportBound rep = GetOffloading(dispatchesViewModel); return(DevExpress.Web.Mvc.ReportViewerExtension.ExportTo(rep)); }