以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=30652)

--  作者:wsxdwh
--  发布时间:2013/4/1 16:27:00
--  [求助]

以下代码如何修改? 请指教!!!

执行后只有第一个区有领队名字,后面没有.

 

Tables("报名表").Filter=" 竞赛名称=\'" & jsmc.text & "\'"
Tables("报名表").Sort = "区号,中小学,学校"

Dim doc As New PrintDoc
Dim r As New prt.RenderText
Dim rt As New prt.RenderText
Dim ra1 As New prt.RenderArea
Dim ra2 As New prt.RenderArea
Dim a As WinForm.ComboBox = Forms("报名表_编排").Controls("竞赛名称")
Dim Str  As  String =Forms("报名表_编排").Controls("竞赛名称").text
Dim str1 As String = str.SubString(0,4)
Dim str2 As String = str.SubString(4)
\'设置表名
r = New prt.RenderText
r.Text= str1 & "年武汉市中小学" & str2 & "竞赛"
\'r.Style.FontSize = 16
r.Style.Font = New Font("楷体", 16, FontStyle.Bold)
r.Style.FontBold = True
r.Style.TextAlignHorz = prt.AlignHorzEnum.Center
r.Style.Spacing.Bottom = 5
doc.Body.Children.Add(r)
r = New prt.RenderText
r.Text= "号码对照表"
\'r.Style.FontSize = 16
r.Style.Font = New Font("楷体", 16, FontStyle.Bold)
r.Style.FontBold = True
r.Style.TextAlignHorz = prt.AlignHorzEnum.Center
r.Style.Spacing.Bottom = 5
doc.Body.Children.Add(r)

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

\'打印一级分组的组名
rt.Text= "[Fields!区.Value]代表队:      领队:   [Fields!领队.Value]"
rt.Style.FontSize = 12
rt.Style.FontBold = True
rt.Style.Spacing.Bottom = 2
ra1.Children.Add(rt)

ra2 = New prt.RenderArea
ra2.Width = 33
ra2.Style.Spacing.Bottom = 1
ra2.Stacking = prt.StackingRulesEnum.InlineLeftToRight
rt = New prt.RenderText
rt.Text = "[Fields!编号.Value]"
rt.Width = 15
rt.Style.FontSize = 10
ra2.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "[Fields!姓名.Value]"
rt.Width = 18
rt.Style.FontSize = 10
ra2.Children.Add(rt)
ra2.DataBinding.DataSource = ra1.DataBinding.DataSource
ra1.Children.Add(ra2)

doc.body.Children.Add(ra1)
Doc.PageSetting.LeftMargin = 25 \'设置左边距
Doc.PageSetting.RightMargin = 15 \'设置右边距
Doc.PageSetting.TopMargin = 15 \'设置上边距
Doc.PageSetting.BottomMargin = 15 \'设置下边距

Tables("报名表").Sort = ""
doc.Preview()


图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看

--  作者:XYT
--  发布时间:2013/4/1 16:57:00
--  
领队那表的值有没有问题?检查下
[此贴子已经被作者于2013-4-1 16:56:46编辑过]