这样实现:
在窗口中添加图片浏览器,生成专业报表并在图片浏览器中显示,代码如下:
Dim pb As WinForm.PictureBox = e.Form.Controls("PictureBox1")
Dim doc As New PrintDoc '定义一个新报表
Dim rt As New prt.RenderTable '定义一个新表格
Dim ColNames As String() = New String(){"客户","产品", "数量","单价","金额"}
Dim drs As List(of DataRow) = DataTables("订单").Select("日期 = #" & Date.Today & "#")
For c As Integer = 0 To ColNames.Length - 1 '逐列设置和填入内容
rt.Cells(0,c).Text = ColNames(c) '列名作为标题
For r As Integer = 0 To drs.Count -1 '开始填入该列内容
rt.Cells(r + 1, c).Text = drs(r)(ColNames(c))
Next
Next
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray)
doc.Body.Children.Add(rt)
doc.SaveImage("d:\Exporter\test.jpg")
pb.Image = GetImage("d:\Exporter\test_page1.jpg")
[此贴子已经被作者于2015-1-15 14:08:31编辑过]