以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [原创]紧急求助  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=113454)

--  作者:glhyg
--  发布时间:2018/1/16 12:11:00
--  [原创]紧急求助
请教老师:
      我是初学者。如何通过筛选树选择,实现WORD报表批量打印。

1、左treeview图筛选右Teble表内容

2、批量打印代码
Dim dt1 As WinForm.treeview = e.Form.Controls("treeview1")
Dim drs As List(of DataRow) = DataTables("b1").Select("乡镇|村 =  \'&dt1.AllNodes & \' ") \'筛选出符合条件的行
If drs.Count > 0 Then \'如果存在符合条件的行
    Dim tm As String  = ProjectPath & "Attachments\\123.doc" \'指定模板文件
    Dim fl As String = ProjectPath & "Reports\\5.doc" \'指定目标文件
    Dim wrt As New WordReport(Tables("b1"),tm,fl) \'定义一个WordReport
    For Each dr As DataRow In drs \'逐行生成报表
        wrt.BuildOne(dr)
    Next
    wrt.print \'显示报表
   wrt.quit
End If
此主题相关图片如下:捕获.png
按此在新窗口浏览图片

--  作者:有点甜
--  发布时间:2018/1/16 12:14:00
--  
不要重复发帖
--  作者:glhyg
--  发布时间:2018/1/16 12:33:00
--  
下不为例!