以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  只打印新增的记录  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=145765)

--  作者:rgbjwjb
--  发布时间:2020/2/6 20:13:00
--  只打印新增的记录
假定“兑付明细表”的字段有:“债权人”、“银行类别”、“银行网点”、“银行账号”、“融资金额”、“本次结算金额”六个字段,我想实现下面两个功能:
1、只打印新增的记录
2、按“银行类别”分组统计“本次结算金额”
请问这个打印代码如何写?
谢谢老师!

--  作者:rgbjwjb
--  发布时间:2020/2/7 14:29:00
--  
Dim idx As Integer = DataTables("兑付明细表").SQLCompute("max([_identify])")
DataTables("兑付明细表").LoadFilter ="[_identify] >" & idx
DataTables("兑付明细表").Load()

Dim t As Table = Tables("兑付明细表")
Dim g As Subtotalgroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = False

g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "银行类别"
g.TotalOn = "借款金额,应结金额"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)
t.Subtotal()
\'

Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim Count As Integer = 0
For Each Col As Col In t.Cols
    rt.Cells(0,Count).Text = Col.Name
    For r As Integer = 0 To t.Rows.Count - 1
        rt.Cells(r +1,Count).Text = t.Rows(r)(Col.Name)
    Next
    Count = Count + 1
Next
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray)
rt.CellStyle.Spacing.All = 1
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center
doc.Body.Children.Add(rt)
doc.Preview()

老师你好!我试着并接了上述代码,生成的表中有合计数,但预览的时候没有,请问如何修改?谢谢!!

--  作者:有点蓝
--  发布时间:2020/2/7 15:54:00
--  
筛选掉非新增的行:http://www.foxtable.com/webhelp/topics/0450.htm