-- 作者:aidimeng
-- 发布时间:2021/8/11 14:46:00
-- 传pdf给客户端问题
Dim e As RequestEventArgs = args(0) Dim r As DataRow = args(1) Dim drr As DataRow= DataTables("系统设置").Find("图章存储位置<>\'\'") Dim ps As System.Diagnostics.Process() = System.Diagnostics.Process.GetProcessesByName("excel") For Each p As System.Diagnostics.Process In ps p.kill Next Dim Proc As New Process \'打开PDF文件 Dim cmd As new SQLCommand cmd.C cmd.CommandText="s elect 签名 from 用户表 where username =\'"& r("审核") &"\'" Dim shqm As String= cmd.ExecuteScalar \'Dim r As Row = Tables("质检报告主表").Current
If r("单据状态")<>"" Then If r("报告类型")="包装油出厂检验报告" Then
Dim Book As New XLS.Book(drr("图章存储位置")& "Attachments\\"& r("报告类型") &".xlsx") Dim fl1 As String = "d:\\ "& "PDF"& format(now(),"yyMMdd")& Rand.Next(100) &".pdf"
If r("质检员")="" Then MessageBox.Show("尚未制定质检员,请选择") Return 0 End If book.AddDataTable("质检报告主表","pk","S elect * from 质检报告主表 where 编号= \'"& r("编号")&"\'") \'添加父表 book.AddDataTable("质检报告附表","pk","S elect * from 质检报告附表 where 编号= \'"& r("编号") &"\'") \'添加子表 book.AddDataTable("成品有出厂检验","pk","S elect * from 成品有出厂检验 where 编号= \'"& r("编号") &"\'And 产品名称=\'"& Vars("pinming") &"\' and 规格=\'"& Vars("guige") &"\'") \'添加子表 book.AddRelation("质检报告主表","编号","质检报告附表","编号") \'建立关联 book.AddRelation("质检报告主表","编号","成品有出厂检验","编号") \'建立关联 Dim Sheet As XLS.Sheet = Book.Sheets(0) Sheet(10,2).Value = New XLS.Picture(GetImage(r("质检员"))) Sheet(10,7).Value =New XLS.Picture(GetImage(shqm)) Book.Build() \'生成细节区 Sheet = Book.Sheets(0) \'Dim dr As DataRow= DataTables("系统设置").Find("图章存储位置<>\'\'") Sheet(Sheet.Rows.Count-7, 4).Value = New XLS.Picture(GetImage(drr("质检公章"))) Dim str As String book.Savetopdf(fl1) \'e.WriteBook(fl,"PDF"& format(now(),"yyMMdd")& Rand.Next(100) &".pdf",False) e.WriteFile(fl1) \'Proc.File = fl \'Proc.Start() \' End If Else \' MessageBox.Show("请先审核单据在生成报告") Return 0 End If e.Handled = True
上面是内部函数
e.AsyncExecute = True Functions.AsyncExecute("baogao",e,r) Return
这里是调用
电脑端访问可以,就是速度很慢,想加个进度条,不知道怎么完成,手机端访问打开的
是 test.htm的 源码
[此贴子已经被作者于2021/8/11 14:49:23编辑过]
|