public ActionResult GenerateReportGeneratedPoints(GeneratedPointsReportFiltersModel filters) { var reporteFactory = new ReportFactory(); var shopName = filters.ShopId.HasValue ? _shopService.GetById(filters.ShopId.Value).Name : PointExResources.LabelAll; var educationalInstitutionName = filters.EducationalInstitutionId.HasValue ? _educationalInstitutionService.GetById(filters.EducationalInstitutionId.Value).Name : PointExResources.LabelAll; var beneficiaryName = filters.BeneficiaryId.HasValue ? _beneficiaryService.GetById(filters.BeneficiaryId.Value).Name : PointExResources.LabelAll; reporteFactory .SetParameter("From", filters.From.ToShortDateString(null)) .SetParameter("To", filters.To.ToShortDateString(null)) .SetParameter("EducationalInstitutionName", educationalInstitutionName) .SetParameter("BeneficiaryName", beneficiaryName) .SetParameter("ShopName", shopName) .SetParameter("ShowEducationalInstitution", AppSettings.ShowEducationalInstitution.ToString()); var points = _reportService.GeneratedPoints(filters.From.AbsoluteStart(), filters.To.AbsoluteEnd(), filters.ShopId, filters.BeneficiaryId, filters.EducationalInstitutionId); reporteFactory.SetDataSource("GeneratedPointsDataSet", points) .SetFullPath(Server.MapPath("~/Reports/GeneratedPoints.rdl")); byte[] reportFile = reporteFactory.Render(filters.ReportType); return(File(reportFile, reporteFactory.MimeType)); }
public ActionResult GeneratedPoints(GeneratedPointsReportFiltersModel filters) { if (filters != null) { filters.ReportName = "GeneratedPoints"; } return(View(filters)); }