我没有加载表创建关联的方式 是直接用如下代码关联的 麻烦老师指导下 谢谢!
运行代码:
Functions.Execute("财产收入情况申报表","fb91f7ee-bbe6-4f38-84f8-ea8532abc636")
得到三楼图片结果 其中亲属明细 房产 车辆 股piao明细都没有显示出来
财产收入情况申报表内部函数代码:
Dim tbn As String = args(0) '表名传参
Dim Book As New XLS.Book(ProjectPath & "Attachments\财产收入情况申报表.xlsx")
Dim fl As String = ProjectPath & "Reports\财产收入情况申报表.xlsx"
book.AddDataTable("填报人信息","user","Se lect * from {填报人信息} where uuid= '" & tbn & "'") '添加父表
book.AddDataTable("亲属信息","user","Sel ect * from {亲属信息} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("收入情况","user","Sele ct * from {收入情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("存款情况","user","Sel ect * from {存款情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("其他投资","user","Sel ect * from {其他投资} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("债务情况","user","Sel ect * from {债务情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("私人借款","user","Sel ect * from {私人借款} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("债权情况","user","Sele ct * from {债权情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("其他说明","user","Sel ect * from {其他说明} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("经商办企业情况","user","Sel ect * from {经商办企业情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("车辆情况","user","Sel ect * from {车辆情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("房产情况","user","Sele ct * from {房产情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("投资情况","user","Sele ct * from {投资情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("持有基金情况","user","Se lect * from {持有基金情况} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("持有期货","user","Sel ect * from {持有期货} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("持有其他投资","user","Sel ect * from {持有其他投资} where uuid= '" & tbn & "'") '添加子表
book.AddDataTable("投资公司企业情况","user","Se lect * from {投资公司企业情况} where uuid= '" & tbn & "'") '添加子表
book.AddRelation("填报人信息","uuid","亲属信息","uuid") '建立关联
book.AddRelation("填报人信息","uuid","收入情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","存款情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","债务情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","私人借款","uuid") '建立关联
book.AddRelation("填报人信息","uuid","债权情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","其他说明","uuid") '建立关联
book.AddRelation("填报人信息","uuid","经商办企业情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","车辆情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","房产情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","投资情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","持有基金情况","uuid") '建立关联
book.AddRelation("填报人信息","uuid","持有期货","uuid") '建立关联
book.AddRelation("填报人信息","uuid","持有其他投资","uuid")
book.AddRelation("填报人信息","uuid","投资公司企业情况","uuid") '建立关联
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
三个表都有数据 且uuid都是相等的
此主题相关图片如下:1.png
此主题相关图片如下:2.png
此主题相关图片如下:3.png