以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]打印代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=89029)

--  作者:zcgmxf
--  发布时间:2016/8/14 7:35:00
--  [求助]打印代码

老师,我的这段打印代码以前可以执行,重装系统后 就不能执行了,并且执行就死机。不知道什么原因。请指点,谢谢!

 

If Tables("一类疫苗入库单").current IsNot Nothing AndAlso Tables("一类疫苗入库单.一类疫苗入库表").current IsNot Nothing Then
    Dim tm As String  = ProjectPath & "Attachments\\打印一类疫苗入库单.doc" \'指定模板文件
    Dim fl As String = ProjectPath & "Reports\\打印一类疫苗入库单.doc" \'指定目标文件
    Dim wrt As New WordReport(Tables("一类疫苗入库单"),tm,fl) \'定义一个WordReport
    wrt.Build() \'逐行生成报表
    wrt.Show()
Else
    MessageBox.Show("没有入库单或入库明细!","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)
    Return
End If

 

在主菜单 点击生成报表 也死机

 

(已解决)原来是WPS设为默认打开所有doc 文档了。

[此贴子已经被作者于2016/8/14 9:32:35编辑过]