Exemplo n.º 1
0
        //导入模板
        public IActionResult ExcelTemplate(string ReportID)
        {
            var report = _reportServices.GetReprot(ReportID);

            //var outputDir = GetProjectDir("UserFiles\\Report\\" + uid+"_template_" + report.ReportID+ "\\");
            //if (!Directory.Exists(outputDir))
            //{
            //    Directory.CreateDirectory(outputDir);
            //}
            //var excel = new ExcelUtility(new List<List<string>>().AddRowToFirst(report.HeadFields.UnPackString(';')),
            //    GetProjectDir("UserFiles\\Report\\Template.xlsx"),
            //   outputDir + report.ReportName + "_Template.xlsx").ToExcel();
            //return Json(State.Success, new { path = ToVirtualPath(excel.FullName) });

            return(Json(State.Success, new List <List <string> >().AddRowToFirst(report.HeadFields.UnPackString(';')), false));

            // return File(ToVirtualPath(excel.FullName), "application/vnd.ms-excel", Url.Encode(report.ReportName + "_Template.xlsx"));
        }
Exemplo n.º 2
0
 public ActionResult Edit(string id)
 {
     InitForm("编辑报表");
     return(View(Edit_M.ToViewModel(reportServices.GetReprot(id))));
 }