生成报表代码如下,报表模板如图一,为什么生成的报表只有No.3的数据,没有No.2的数据?老师,会是什么问题?Systemready = False
DataTables("申请费用表").loadTop = ""
DataTables("申请费用表").loadpage = 0
DataTables("申请费用表").load
Systemready = True
Dim str = DataTables("变更申请单").SQLGetComboListString("项目名称+变更编号", DataTables("变更信息表").LoadFilter & " And 业主审批=1")
str = str.replace("|", "','")
DataTables("申请费用表").LoadFilter = "项目名称+变更编号 in ('" & str & "')"
DataTables("申请费用表").LoadTop = ""
DataTables("申请费用表").LoadPage = 0
DataTables("申请费用表").Load
Dim Book As New XLS.Book(ProjectPath & "Attachments\变更统计表2.xlsx")
Dim fl As String = ProjectPath & "Reports\变更统计表2.xlsx"
Book.Build() '生成细节区
Book.Save(fl) '保存工作簿
Dim Sheet As XLS.Sheet = Book.Sheets(0)
With Sheet.PrintSetting
.PaperKind = 9 '设为A4纸
.LandScape = True '横向打印
.MarginLeft = 5 '左右边距设为5毫米
.MarginRight = 5
.MarginTop = 15 '上下边距设为15毫米
.MarginBottom = 10
End With
Dim Proc As New Process '打开工作簿
Proc.File = fl
Proc.Start()
图一:
此主题相关图片如下:1111.png
图二:
此主题相关图片如下:2222.png