以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  黄色底部分是这么写吗?报错  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=136333)

--  作者:yetle
--  发布时间:2019/6/11 15:15:00
--  黄色底部分是这么写吗?报错
Dim Book As New XLS.Book(ProjectPath & "Attachments\\工序派工.xls")
Dim fl As String = ProjectPath & "Reports\\工序派工.xls"
book.AddDataTable("派工表","XSC_ERP","Select * fr om {派工表} where 订单号= \'" & Tables("分派工序_table1").current("订单号") & "\'") \'添加父表

Book.Build() \'生成细节区
Book.Save(fl) \'保存工作簿
Dim Proc As New Process \'打开工作簿
Proc.File = fl
Proc.Start()

提示
.NET Framework 版本:2.0.50727.3655
Foxtable 版本:2019.4.12.1
错误所在事件:窗口,分派工序,Button32,Click
详细错误信息:
未将对象引用设置到对象的实例。


--  作者:有点蓝
--  发布时间:2019/6/11 20:25:00
--  
if  Tables("分派工序_table1").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 * fr om {派工表} where 订单号= \'" & Tables("分派工序_table1").current("订单号") & "\'") \'添加父表

Book.Build() \'生成细节区
Book.Save(fl) \'保存工作簿
Dim Proc As New Process \'打开工作簿
Proc.File = fl
Proc.Start()
end if

--  作者:yetle
--  发布时间:2019/6/13 11:27:00
--  
点这段代码按钮,有时候能预览,又时候又不可以
--  作者:有点甜
--  发布时间:2019/6/13 13:21:00
--  
以下是引用yetle在2019/6/13 11:27:00的发言:
点这段代码按钮,有时候能预览,又时候又不可以

 

不可以的时候,是预览不出现,还是预览时没有数据?


--  作者:yetle
--  发布时间:2019/6/13 14:42:00
--  
预览的界面没有弹出来
--  作者:有点甜
--  发布时间:2019/6/13 16:29:00
--  
以下是引用yetle在2019/6/13 14:42:00的发言:
预览的界面没有弹出来

 

你table1没有数据的时候,就会不弹出的。

 

 


--  作者:yetle
--  发布时间:2019/6/18 15:31:00
--  
打印按钮代码
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

--  作者:有点甜
--  发布时间:2019/6/18 15:45:00
--  

1、分组生成

 

http://www.foxtable.com/webhelp/topics/1542.htm

 

2、用标签处理

 

http://www.foxtable.com/webhelp/topics/1414.htm

 

3、不会做上传实例