Foxtable(狐表)用户栏目专家坐堂 → [求助]


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

主题:[求助]

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


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/20 18:09:00 [显示全部帖子]

 好的,变成这样。

Dim doc As New PrintDoc
Dim rt As New prt.RenderText
Dim ra1 As New prt.RenderArea
Dim ra2 As New prt.RenderArea
Dim ra3 As New prt.RenderArea

'设置一级分组
ra1.Style.Spacing.Bottom = 2
ra1.DataBinding.DataSource = BindTables("报名表")
ra1.DataBinding.Grouping.Expressions.Add("Fields!区.Value")

'打印一级分组的组名
rt.Text= "[Fields!区.Value]:"
rt.Style.FontSize = 14
rt.Style.FontBold = True
rt.Style.Spacing.Bottom = 2
ra1.Children.Add(rt)
'设置二级分组
ra2 = New Prt.RenderArea
ra2.Style.Spacing.Bottom = 2
ra2.DataBinding.DataSource = ra1.DataBinding.DataSource
ra2.DataBinding.Grouping.Expressions.Add("Fields!学校.Value")
ra1.Children.Add(ra2)


'打印二级分组的组名
rt = New prt.RenderText
rt.Text= "[Fields!学校.Value]:"
rt.Style.FontSize = 12
rt.Style.FontBold = True
rt.Style.Spacing.Bottom = 2
ra2.Children.Add(rt)


'设置标签内容
ra3 = New prt.RenderArea
rt = New prt.RenderText
rt.Text = "编号:[Fields!编号.Value]"
ra3.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "姓名:[Fields!姓名.Value]"
ra3.DataBinding.DataSource = ra2.DataBinding.DataSource
ra3.Children.Add(rt)
ra2.Children.Add(ra3)


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


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


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/20 21:41:00 [显示全部帖子]

 明天吧,楼主,数据不再我机子上。明天帮你试一下。

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


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/21 9:45:00 [显示全部帖子]

 好的,这样就差不多了。

Dim doc As New PrintDoc
Dim rt As New prt.RenderText
Dim ra1 As New prt.RenderArea
Dim ra2 As New prt.RenderArea
Dim ra3 As New prt.RenderArea

'设置一级分组
ra1.Style.Spacing.Bottom = 2
ra1.DataBinding.DataSource = BindTables("报名表")
ra1.DataBinding.Grouping.Expressions.Add("Fields!区.Value")

'打印一级分组的组名
rt.Text= "[Fields!区.Value]:"
rt.Style.FontSize = 14
rt.Style.FontBold = True
rt.Style.Spacing.Bottom = 2
ra1.Children.Add(rt)
'设置二级分组
ra2 = New Prt.RenderArea
ra2.Style.Spacing.Bottom = 2
ra2.Stacking = prt.StackingRulesEnum.InlineLeftToRight
ra2.DataBinding.DataSource = ra1.DataBinding.DataSource
ra2.DataBinding.Grouping.Expressions.Add("Fields!学校.Value")
ra1.Children.Add(ra2)

'打印二级分组的组名
ra3 = New prt.RenderArea
ra3.Stacking = prt.StackingRulesEnum.InlineLeftToRight
rt = New prt.RenderText
rt.Text= "[Fields!学校.Value]:"
rt.Style.FontSize = 12
rt.Style.FontBold = True
rt.Style.Spacing.Bottom = 2
ra3.Children.Add(rt)
For i As Integer = 0 To 4
    rt = New prt.RenderText
    rt.Text = "编号"
    rt.Width = 15
    ra3.Children.Add(rt)
    rt = New prt.RenderText
    rt.text = "姓名"
    rt.width = 15
    ra3.Children.Add(rt)
Next
ra2.Children.Add(ra3)

'设置标签内容
ra3 = New prt.RenderArea
ra3.Width = 30
ra3.Stacking = prt.StackingRulesEnum.InlineLeftToRight
rt = New prt.RenderText
rt.Text = "[Fields!编号.Value]"
rt.Width = 15
ra3.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "[Fields!姓名.Value]"
rt.Width = 15
ra3.DataBinding.DataSource = ra2.DataBinding.DataSource
ra3.Children.Add(rt)
ra2.Children.Add(ra3)


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


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


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/12/21 9:50:00 [显示全部帖子]

 简单测试数据,楼主放心,没有人名。

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.table


 回到顶部