Foxtable(狐表)用户栏目专家坐堂 → 分组统计汇总


  共有2738人关注过本帖树形打印复制链接

主题:分组统计汇总

帅哥哟,离线,有人找我吗?
yifan3429
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2466 积分:22761 威望:0 精华:0 注册:2011/3/29 17:14:00
分组统计汇总  发帖心情 Post By: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编辑过]

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106763 积分:543016 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/3/14 20:18:00 [只看该作者]


 回到顶部