以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  后台输出失败  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=185140)

--  作者:lihe60
--  发布时间:2023/2/7 10:30:00
--  后台输出失败
Dim filter As String
Dim Book As New XLS.Book(ProjectPath & "Attachments\\销售合同.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Sheet(6, 6).Value = "制单人:" & User.Name \'修改模板,加入制单人信息
filter = "Sel\\ect * from {表B} where [_identify]=2"
Dim fl As String = ProjectPath & "Reports\\出库单.xls"
book.AddDataTable("表B", "", filter) \'添加父表
filter = "Sel\\ect * from {表C} where [_identify]=2"
book.AddDataTable("表C", "" , filter) \'添加子表
book.AddRelation("表B", "[_identify]", "表C", "[_identify]") \'建立关联
messagebox.show(4)
Book.Build() \'生成细节区
Book.Save(fl) \'保存工作簿
messagebox.show(5)
Dim Proc As New Process \'打开工作簿
Proc.File = fl
Proc.Start()

--  作者:有点蓝
--  发布时间:2023/2/7 10:32:00
--  
_identify列不能用来做关联