Dim doc As New PrintDoc '定义一个报表
Dim t As Table = Tables("会议纪要") '定义一个数据表
For i As Integer = t.TopPosition To t.BottomPosition
Dim r As Row = t.Rows(i)
Dim ra As New prt.RenderArea '定义一个容器
Dim rt As prt.RenderText '定义一个文本对象
ra.Style.Spacing.All = 1 '设置各个方面的间隔
ra.Style.Borders.All = New prt.Linedef(0.3, Color.Red) '设置边框
ra.SplitHorzBehavior = prt.SplitBehaviorEnum.Never '禁止水平分割
ra.SplitVertBehavior = prt.SplitBehaviorEnum.SplitIfNeeded '允许垂直分割
Doc.Body.ChildRen.Add(ra) '将文本对象(容器)加入到报表中
rt = New prt.RenderText '创建文本对象
rt.Text = "中共涟源市杨市镇中心卫生院支部委员会" '设置文本对象的内容
rt.X = 40
rt.Y = 2
ra.Children.Add(rt) '添加到容器中
rt = New prt.RenderText
rt.Text = "时 间:"
rt.X = 2
rt.Y = "Prev.Bottom + 2" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("时间")
rt.X = 20
rt.Y = "Prev.Top" '垂直坐标和前一对象相同
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "地 点:"
rt.X = 2
rt.Y = "Prev.Bottom + 2" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("地点")
rt.X = 20
rt.Y = "Prev.Top" '垂直坐标和前一对象相同
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = "与会党员:"
rt.X = 2
rt.Y = "Prev.Bottom + 2" '垂直坐标位于迁移对象之下的2毫米
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("与会党员")
rt.X = 20
rt.Y = "Prev.Top" '垂直坐标和前一对象相同
ra.Children.Add(rt)
If r("列席人员") <> Nothing Then
rt = New prt.RenderText
rt.Text = "列席人员:"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("列席人员")
rt.X = 20
rt.Y = "Prev.Top"
ra.Children.Add(rt)
End If
If r("上级领导") <> Nothing Then
rt = New prt.RenderText
rt.Text = "上级领导:"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("上级领导")
rt.X = 20
rt.Y = "Prev.Top"
ra.Children.Add(rt)
End If
If r("会议议题") <> Nothing Then
rt = New prt.RenderText
rt.Text = "会议议题:"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("会议议题")
rt.X = 20
rt.Y = "Prev.Top"
ra.Children.Add(rt)
End If
If r("主持人") <> Nothing Then
rt = New prt.RenderText
rt.Text = "主 持 人:"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("主持人")
rt.X = 20
rt.Y = "Prev.Top"
ra.Children.Add(rt)
End If
If r("主讲人") <> Nothing Then
rt = New prt.RenderText
rt.Text = "主 讲 人:"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("主讲人")
rt.X = 20
rt.Y = "Prev.Top"
ra.Children.Add(rt)
End If
If r("会议内容") <> Nothing Then
rt = New prt.RenderText
rt.Text = "会议内容:"
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
rt = New prt.RenderText
rt.Text = r("会议内容")
rt.X = 2
rt.Y = "Prev.Bottom + 2"
ra.Children.Add(rt)
End If
ra.BreakBefore = prt.BreakEnum.Page
Next
Doc.Preview() '预览报表