Foxtable(狐表)用户栏目专家坐堂 → 专业报表怎么让绑定的数字字段按千分位显示?


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

主题:专业报表怎么让绑定的数字字段按千分位显示?

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


加好友 发短信
等级:三尾狐 帖子:640 积分:5407 威望:0 精华:0 注册:2014/8/27 11:12:00
专业报表怎么让绑定的数字字段按千分位显示?  发帖心情 Post By:2015/8/31 11:23:00 [只看该作者]

用户已经被屏蔽

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/8/31 11:30:00 [只看该作者]

Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim tb As Table = Tables("订单")
Dim ColNames As String() = New String(){"产品", "客户","单价", "数量", "金额"}
For c As integer = 0 To ColNames.Length -1
    rt.Cells(0,c).Text = ColNames(c)
    rt.Cols(c).Width = tb.Cols(ColNames(c)).PrintWidth
    If ColNames(c) = "金额" OrElse ColNames(c) = "数量" Then
        rt.Cells(1, c).Text = "[format(Fields!" & ColNames(c) & ".Value, ""#,###"")]" '设置绑定表达式
    Else
        rt.Cells(1, c).Text ="[Fields!"&ColNames(c)&".Value]"
    End If
Next
rt.RowGroups(0,1).Style.TextAlignVert = prt.AlignVertEnum.Center '第一行内容垂直居中
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All '将第一行作为表头.
rt.RowGroups(1,1).DataBinding.DataSource = BindTables("订单") '将第二行绑定到订单表
doc.Body.Children.Add(rt)
doc.Preview()


 回到顶部