|

楼主 |
发表于 2013-5-15 11:00:00
|
显示全部楼层
编辑word文档,填充域
详细步骤请参考 使用word模板
http://bbs.justep.com/forum.php?mod=viewthread&tid=34143
下面给出了一段js代码,从'dataMain'组件中取当前行的数据,填充到word文档中- function officeAutomation() {
- var data = justep.xbl('dataMain');
- var sIssue = data.getValue('fIssueDate');
- var dIssue = justep.Date.fromString(sIssue,'yyyy-MM-ddThh:mm:ss');// 转换成日期
-
- var p = { "发文编号" : data.getValue("fDocNumber"),
- "签发人" : data.getValue("fSignPerName"),
- "签发日期" : data.getValue("fSignTime"),
- "主送" : data.getValue("fMainDestDept"),
- "抄送" : data.getValue("fCopyDestDept"),
- "年" : dIssue.getYear(),
- "月" : dIssue.getMonth()+1,
- "日" : dIssue.getDate() };
- var a = document.getElementById('attachmentEditor1_docExtObj');
- a.excuteJSmethod('ov.WordAutoFillFields', OV.JSON.stringify(p));
- };
复制代码 |
|