以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  窗体打印分页求和编码求助?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=104176)

--  作者:有点蓝
--  发布时间:2017/7/24 21:51:00
--  
参考:http://foxtable.com/bbs/dispbbs.asp?boardid=2&Id=93847

Dim doc As PrintDoc = e.Form.GernatePrintDoc()
Dim idx As Integer = 0
Dim idx2 As Integer = 0
Dim t As Table = e.Form.Controls("Table1").Table
For Each c As object In Doc.Body.Children
    If Typeof c Is prt.RenderText Then
        If c.text = "合计金额" Then
            Dim count As Double = 0
            For i As Integer = idx To idx + 7
                count += val(t.Rows(i)("实报金额合计"))
            Next
            c.text = "合计金额" &  cstr(count)
            idx += 8
        End If
    End If
Next
doc.Preview()

--  作者:有点甜
--  发布时间:2017/7/27 10:16:00
--  

 直接放在你的打印按钮里面。