此主题相关图片如下:image 1.jpg
doc.PageSetting.Landscape = True '横向打印
rt.Style.TextColor = Color.black
rt.Style.Font = New Font("宋体", 32, FontStyle.Bold) '设置字体
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.FontBold = True '字体加粗
rt.Style.Spacing.Bottom = 3
doc.Body.Children.Add(rt) '将文本对象加入到报表
'Doc.PageSetting.LeftMargin = 100 '设置左边距
'Doc.PageSetting.RightMargin = 1'设置右边距
Doc.PageSetting.TopMargin = 80 '设置上边距
'------------TextBox1的打印内容
'rt.Text =tx1 & "年月" '设置文本对象的内容
rt = New prt.RenderText '定义一个文本对象
Dim str001 As String=e.Form.controls("TextBox1").value
Dim str002 As String=str001.SubString(0,4)
Dim str003 As String=str001.SubString(4,2)
rt.Text ="养护月份:" & str002 & "年" & str003 & "月" '设置文本对象的内容
rt.Style.TextColor = Color.black
rt.Style.Font = New Font("宋体", 18, FontStyle.Bold) '设置字体
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.FontBold = True '字体加粗
' rt.Style.FontUnderline = True '加下横线
rt.Style.Spacing.Bottom = 3
doc.Body.Children.Add(rt) '将文本对象加入到报表
rt = New prt.RenderText '定义一个文本对象
'------------TextBox2的打印内容
rt = New prt.RenderText '定义一个文本对象
Dim yhrq1 As String=e.Form.controls("TextBox2").value
Dim yhrq2 As String=yhrq1.SubString(0,4)
Dim yhrq3 As String=yhrq1.SubString(4,2)
Dim yhrq4 As String=yhrq1.SubString(6,2)
rt.Text ="养护日期:" & yhrq2 & "年" & yhrq3 & "月" & yhrq4 & "日" '设置文本对象的内容
rt.Style.TextColor = Color.black
rt.Style.Font = New Font("宋体", 18, FontStyle.Bold) '设置字体
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.FontBold = True '字体加粗
rt.Style.FontUnderline = True '加下横线
rt.Style.Spacing.Bottom = 3
doc.Body.Children.Add(rt) '将文本对象加入到报表
'------------TextBox3的打印内容
rt = New prt.RenderText '定义一个文本对象
rt.Text ="养护人:" & e.Form.controls("TextBox3").value '设置文本对象的内容
rt.Style.TextColor = Color.black
rt.Style.Font = New Font("宋体", 18, FontStyle.Bold) '设置字体
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.FontBold = True '字体加粗
rt.Style.FontUnderline = True '加下横线
rt.Style.Spacing.Bottom = 3
doc.Body.Children.Add(rt) '将文本对象加入到报表
'---------------------打印浏览
doc.Preview() '预览