以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  报表  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=111718)

--  作者:qaz
--  发布时间:2017/12/28 10:59:00
--  报表
需要一次生成两个不同的Word报表应该怎么做?
现在的现象是,生成第二个的时候第一个就会关闭。

--  作者:有点甜
--  发布时间:2017/12/28 11:52:00
--  

你怎么写代码生成的?贴出你写的代码

 

http://www.foxtable.com/webhelp/scr/2890.htm

 


--  作者:qaz
--  发布时间:2017/12/28 15:17:00
--  
Dim tm As String  = ProjectPath & "Attachments\\新装终端标准工事票.doc" \'指定模板文件
Dim fl As String = ProjectPath & "Reports\\新增终端\\" & Tables("终端台账").Rows(Tables("终端台账").Position)("站名") & "新装终端标准工事票" & ".doc" \'指定目标文件
Dim wrt As New WordReport(Tables("终端台账"),tm,fl) \'定义一个WordReport
wrt.Build() \'逐行生成报表
wrt.Show() \'显示报表


Dim tm1 As String  = ProjectPath & "Attachments\\新装电能表工事票模板1.doc" \'指定模板文件
Dim fl1 As String = ProjectPath & "Reports\\新增终端\\" & Tables("电流互感器台账").Rows(Tables("电流互感器台账").Position)("主键") & "新装电能表标准工事票" & ".doc" \'指定目标文件
Dim wrt1 As New WordReport(Tables("电流互感器台账"),tm1,fl1) \'定义一个WordReport
wrt1.Build() \'逐行生成报表
wrt1.Show() \'显示报表


--  作者:有点甜
--  发布时间:2017/12/28 15:22:00
--  

Dim tm As String  = ProjectPath & "Attachments\\新装终端标准工事票.doc" \'指定模板文件
Dim fl As String = ProjectPath & "Reports\\新增终端\\" & Tables("终端台账").Rows(Tables("终端台账").Position)("站名") & "新装终端标准工事票" & ".doc" \'指定目标文件
Dim wrt As New WordReport(Tables("终端台账"),tm,fl) \'定义一个WordReport
wrt.Build() \'逐行生成报表
wrt.quit

Dim tm1 As String  = ProjectPath & "Attachments\\新装电能表工事票模板1.doc" \'指定模板文件
Dim fl1 As String = ProjectPath & "Reports\\新增终端\\" & Tables("电流互感器台账").Rows(Tables("电流互感器台账").Position)("主键") & "新装电能表标准工事票" & ".doc" \'指定目标文件
Dim wrt1 As New WordReport(Tables("电流互感器台账"),tm1,fl1) \'定义一个WordReport
wrt1.Build() \'逐行生成报表
wrt1.quit

Dim proc As new Process
proc.File = fl
proc.Start
Dim proc1 As new Process
proc1.File = fl1
proc1.Start

[此贴子已经被作者于2017/12/28 15:34:02编辑过]

--  作者:qaz
--  发布时间:2017/12/28 15:29:00
--  
好的谢谢
wrt1.Build() \'逐行生成报表
wrt.quit   \' 少写一个1