浏览代码

合并1
OAMethodLib/File/AsposeHelper.cs

leiy 2 年之前
父节点
当前提交
0751f5ca39
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs

+ 4 - 4
OASystem/OASystem.Api/OAMethodLib/File/AsposeHelper.cs

@@ -140,12 +140,12 @@ namespace OASystem.API.OAMethodLib.File
                 {
                     System.IO.Directory.CreateDirectory(path);//不存在就创建文件夹
                 }
+                string saveFilePath = string.Format("{0}{1}", path, saveFilName);
 
-                //合并模版,相当于页面的渲染
-                doc.MailMerge.Execute(new[] { "PageCount" }, new object[] { doc.PageCount });
                 //保存合并后的文档
-                doc.Save(outputPath);
-                return outputPath; //返回下载地址
+                wbook.Save(saveFilePath);
+                saveFilePath = saveFilePath.Replace("C:", AppSettingsHelper.Get("OfficeBaseUrl")); //返回下载地址
+                return saveFilePath; //返回下载地址
             }
             catch (Exception ex)
             {