Beispiel #1
0
        public ActionResult AddCommentToExcelDemo()
        {
            // 1.添加批注
            string filePhysicalPath = SysContext.Config.ReportTemplateDirectory_Physical + "测试模板.xlsx";
            using (ExcelWriter excelWriter = new ExcelWriter(filePhysicalPath, "哈哈"))
            {
                excelWriter.AddCommentToCell(3, 1, "数据格式错误", "必须是GUID");
                excelWriter.AddCommentToCell(3, 8, "数据格式错误", "必须是数字");
            }

            // 2.展现Excel文件
            return View("~/Views/Shared/Controls/ExcelReportView.cshtml", new ExcelDisplayViewModel
            {
                Title = "Excel添加批注 Demo",
                FilePhysicalPath = filePhysicalPath,
                SheetName = "哈哈"
            });
        }
Beispiel #2
0
        public ActionResult AddCommentToExcelDemo()
        {
            // 1.添加批注
            string filePhysicalPath = SysContext.Config.ReportTemplateDirectory_Physical + "测试模板.xlsx";

            using (ExcelWriter excelWriter = new ExcelWriter(filePhysicalPath, "哈哈"))
            {
                excelWriter.AddCommentToCell(3, 1, "数据格式错误", "必须是GUID");
                excelWriter.AddCommentToCell(3, 8, "数据格式错误", "必须是数字");
            }

            // 2.展现Excel文件
            return(View("~/Views/Shared/Controls/ExcelReportView.cshtml", new ExcelDisplayViewModel
            {
                Title = "Excel添加批注 Demo",
                FilePhysicalPath = filePhysicalPath,
                SheetName = "哈哈"
            }));
        }