以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  分组统计汇总  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=161340)

--  作者:yifan3429
--  发布时间:2021/3/13 19:58:00
--  分组统计汇总

Dim doc As New PrintDoc
Dim
rx As New prt.RenderText
Dim
rt As New prt.RenderTable
Dim
Agg1 As New prt.DataBinding.Aggregate("数量小计")
Dim
Agg2 As New prt.DataBinding.Aggregate("金额小计")

rt.Style.GridLines.All = New prt.Linedef(Color.Gray)
rt.CellStyle.Spacing.All =
1
rt.Cells(
0,0).Text = "产品"
rt.Cells(
0,1).Text = "数量"
rt.Cells(
0,2).Text = "金额"
rt.Cells(
1,0).Text = "[Fields!产品.Value]"
rt.Cells(
1,1).Text = "[Aggregates!数量小计.Value]"
rt.Cells(
1,2).Text = "[Aggregates!金额小计.Value]"

With
rt.RowGroups(1,1)
    .DataBinding.DataSource = BindTables(
"订单")
    .DataBinding.Grouping.Expressions.Add(
"Fields!产品.Value")

    agg1.DataBinding = .DataBinding
    agg1.Running = 1
    agg1.ExpressionText =
"Fields!数量.Value"
    doc.DataSchema.Aggregates.Add(agg1)

    agg2.DataBinding = .DataBinding
    agg2.Running = 1
    agg2.ExpressionText =
"Fields!金额.Value"
    doc.DataSchema.Aggregates.Add(agg2)

End With


doc.body.Children.Add(rt)
doc.Preview()


怎么增加一行 统计  数量  金额

[此贴子已经被作者于2021/3/13 19:58:00编辑过]

--  作者:有点蓝
--  发布时间:2021/3/14 20:18:00
--  
参考:http://www.foxtable.com/webhelp/topics/1263.htm