|
@@ -10773,6 +10773,40 @@ ORDER by gctggrc.id DESC
|
|
|
|
|
|
strFileName += "VOUCHER.docx";
|
|
|
|
|
|
+ Document doc = new Document();
|
|
|
+ DocumentBuilder builder = new DocumentBuilder(doc);
|
|
|
+
|
|
|
+ try
|
|
|
+ {
|
|
|
+
|
|
|
+ foreach (var item in hrDtas)
|
|
|
+ {
|
|
|
+ //标题
|
|
|
+ builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Title;
|
|
|
+ builder.Writeln("ACCOMMODATION VOUCHER");
|
|
|
+
|
|
|
+ builder.ParagraphFormat.StyleIdentifier = StyleIdentifier.Title;
|
|
|
+ builder.Writeln($"VOUCHER No:{item.CheckNumber} DATE: {item.CreateTime.ToString("yyyy-MM-dd")}");
|
|
|
+
|
|
|
+ //表格
|
|
|
+ builder.InsertCell(); //插入单元格
|
|
|
+ builder.CellFormat.PreferredWidth = PreferredWidth.FromPercent(20);//列宽 - 百分比
|
|
|
+ builder.CellFormat.PreferredWidth = PreferredWidth.FromPercent(20);//列宽 - 百分比
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+
|
|
|
+ throw;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
var fileDir = AppSettingsHelper.Get("WordBasePath") + strFileName;
|
|
|
//doc.Save(fileDir);
|
|
|
string Url = AppSettingsHelper.Get("WordBaseUrl") + "Office/Word/" + strFileName;
|