打印按钮代码
If Tables("分派工序_table5").current IsNot Nothing Then
Dim Book As New XLS.Book(ProjectPath & "Attachments\分箱汇总打印.xls")
Dim fl As String = ProjectPath & "Reports\分箱汇总打印.xls"
book.AddDataTable("分箱汇总","XSC_ERP","Select * f rom {分箱汇总} where 订单号= '" & Tables("分派工序_table5").current("订单号") & "'") '添加父表
book.AddDataTable("分箱","XSC_ERP","Select * f rom {分箱} where 订单号= '" & Tables("分派工序_table3").current("订单号") & "'") '添加父表
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
End If
打印报表
此主题相关图片如下:qq图片20190618152530.png

存在两个问题:
1、弹出提示:子细节去必须嵌套在父细节区内
2、分箱表显示的箱号,存在的行记录比较多,需指定显示行数,并多列按顺序排列如,该怎么写:
1 |
11 |
21 |
2 |
12 |
22 |
3 |
13 |
23 |
4 |
14 |
24 |
5 |
15 |
25 |
6 |
16 |
26 |
7 |
17 |
27 |
8 |
18 |
28 |
9 |
19 |
29 |
10 |
20 |
30 |