Dim doc As New PrintDoc '定义一个报表
Dim rx As prt.RenderText '定义一个文本对象
Dim CurRow As Row = Tables("piao据明细").Current
doc.PageSetting.Width = 176 '纸张宽度为176毫米
doc.PageSetting.Height = 84 '纸张高度为84毫米
Doc.PageSetting.LeftMargin = 0 '设置左边距
Doc.PageSetting.RightMargin = 0 '设置右边距
Doc.PageSetting.TopMargin = 0 '设置上边距
Doc.PageSetting.BottomMargin = 0 '设置下边距
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("出piao日期").Year
rx.Style.FontSize = 8 '字体大小为8磅
rx.x = 62
rx.y = 13
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("出piao日期").Month
rx.Style.FontSize = 8 '字体大小为8磅
rx.x = 80
rx.y = 13
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CurRow("出piao日期").Day
rx.Style.FontSize = 8 '字体大小为8磅
rx.x = 91
rx.y = 13
rx = new prt.RenderText
rx.Text = CurRow("出piao单位名称")
rx.Style.FontSize = 10 '字体大小为8磅
rx.x = 33
rx.y = 18
rx = new prt.RenderText
rx.Text = CurRow("出piao人账号")
rx.Style.FontSize = 12 '字体大小为12磅
rx.x = 33
rx.y = 25
rx = new prt.RenderText
rx.Text = CurRow("付款行名称")
rx.Style.FontSize = 10 '字体大小为10磅
rx.x = 33
rx.y = 32
rx = new prt.RenderText
rx.Text = CurRow("收款人")
rx.Style.FontSize = 10 '字体大小为10磅
rx.x = 109
rx.y = 18
rx = new prt.RenderText
rx.Text = CurRow("收款账号")
rx.Style.FontSize = 12 '字体大小为12磅
rx.x = 109
rx.y = 25
rx = new prt.RenderText
rx.Text = CurRow("收款开户银行")
rx.Style.FontSize = 10 '字体大小为10磅
rx.x = 109
rx.y = 32
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = CUMoney(CurRow("金额"))
rx.Style.FontSize = 16 '字体大小为16磅
rx.x = 27
rx.y = 40
doc.body.Children.Add(rx)
If GetDigit(CurRow("金额"),8) > "" Then
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),8)
rx.x = 132
rx.y = 44
doc.body.Children.Add(rx)
End If
If GetDigit(CurRow("金额"),7) > "" Then
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),7)
rx.x = 136
rx.y = 44
doc.body.Children.Add(rx)
End If
If GetDigit(CurRow("金额"),6) > "" Then
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),6)
rx.x = 140
rx.y = 44
doc.body.Children.Add(rx)
End If
If GetDigit(CurRow("金额"),5) > "" Then
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),5)
rx.x = 144
rx.y = 44
doc.body.Children.Add(rx)
End If
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),4)
rx.x = 147
rx.y = 44
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),3)
rx.x = 151
rx.y = 44
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),2)
rx.x = 155
rx.y = 44
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),1)
rx.x = 159
rx.y = 44
doc.body.Children.Add(rx)
rx = new prt.RenderText
rx.Text = GetDigit(CurRow("金额"),0)
rx.x = 163
rx.y = 44
doc.body.Children.Add(rx) '将文本对象加入报表
Doc.Preview() '预览报表
以上是专业报表的所有内容。但执行时却报错。
此主题相关图片如下:110.png
这是报错时的提示窗口内容。