Dim tbn As String = args(0) '主表id传参
Dim e As RequestEventArgs = args(1)
Dim tR123 As DataRow = DataTables("h5设置").Find("id = '1'")
Dim cmd As new SQLCom mand
cmd.Connecti onName = tr123("数据库名称")
Dim Book As New XLS.Book(ProjectPath & "Attachments\财产收入情况申报表.xlsx")
Dim fl As String = ProjectPath & "Reports\财产收入情况申报表.xlsx"
Dim f2 As String = ProjectPath & "Reports\财产收入情况申报表.pdf"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
With Sheet.PrintSetting
.PaperKind = 9 '设为A4纸
.LandScape = False '横向打印
.MarginLeft = 10 '左右边距设为20毫米
.MarginRight = 10
.MarginTop = 20 '上下边距设为15毫米
.MarginBottom = 15
End With
book.AddDataTable("填报人信息",tr123("数据库名称"),"Select * fr om {填报人信息} where 主表id= '" & tbn & "'") '添加父表
book.AddDataTable("亲属信息",tr123("数据库名称"),"Select * fro m {亲属信息} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("收入情况",tr123("数据库名称"),"Select * fro m {收入情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("存款情况",tr123("数据库名称"),"Select * fro m {存款情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("其他投资",tr123("数据库名称"),"Select * fro m {其他投资} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("债务情况",tr123("数据库名称"),"Select * fro m {债务情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("私人借款",tr123("数据库名称"),"Select * fro m {私人借款} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("债权情况",tr123("数据库名称"),"Select * fro m {债权情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("其他说明",tr123("数据库名称"),"Select * fro m {其他说明} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("经商办企业情况",tr123("数据库名称"),"Select * fr om {经商办企业情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("车辆情况",tr123("数据库名称"),"Select * fro m {车辆情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("房产情况",tr123("数据库名称"),"Select * fro m {房产情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("股piao信息",tr123("数据库名称"),"Select * fro m {股piao信息} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("持有基金情况",tr123("数据库名称"),"Select * fr om {持有基金情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("持有期货",tr123("数据库名称"),"Select * fro m {持有期货} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("持有其他投资",tr123("数据库名称"),"Select * fro m {持有其他投资} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("投资公司企业情况",tr123("数据库名称"),"Select * fr om {投资公司企业情况} where 主表id= '" & tbn & "'") '添加子表
book.AddDataTable("其他财产申报",tr123("数据库名称"),"Select * fro m {其他财产申报} where 主表id= '" & tbn & "'") '添加子表
book.AddRelation("填报人信息","主表id","亲属信息","主表id") '建立关联
book.AddRelation("填报人信息","主表id","收入情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","存款情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","其他投资","主表id") '建立关联
book.AddRelation("填报人信息","主表id","债务情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","私人借款","主表id") '建立关联
book.AddRelation("填报人信息","主表id","债权情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","其他说明","主表id") '建立关联
book.AddRelation("填报人信息","主表id","经商办企业情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","车辆情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","房产情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","股piao信息","主表id") '建立关联
book.AddRelation("填报人信息","主表id","持有基金情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","持有期货","主表id") '建立关联
book.AddRelation("填报人信息","主表id","持有其他投资","主表id")
book.AddRelation("填报人信息","主表id","投资公司企业情况","主表id") '建立关联
book.AddRelation("填报人信息","主表id","其他财产申报","主表id") '建立关联
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
book.SaveToPDF(f2)
e.WriteString(f2)
e.Handled = True '通知系统异步函数执行完毕,可以关闭信道