Exemple #1
0
 public HomeController(ReportAppService reportApp, MenuService moduleApp, DicService dicItemApp, RoleService roleApp, OrgService orgApp)
 {
     ReportApp  = reportApp;
     ModuleApp  = moduleApp;
     DicItemApp = dicItemApp;
     RoleApp    = roleApp;
     OrgApp     = orgApp;
 }
Exemple #2
0
        public string GenerateReport()
        {
            string className    = typeof(TEntity).Name;
            string templateName = ReportAppService.WebRootPath + "/template/" + className + ".xlsx";
            var    data         = Repository.GetAll().ToList();
            var    wb           = ReportAppService.GenerateReport(new{ data = data, Count = data.Count, className }, templateName);
            string guid         = Guid.NewGuid().ToString("N") + ".pdf";

            wb.Save(ReportAppService.WebRootPath + "/reports/" + guid, SaveFormat.Pdf);
            return(guid);
        }