老师,我现在做了分页处理,当我需要打印选择的不同的页的标签时,只能打印到当前页的?其他页选择的生存不了标签,怎么筛选不不同页的选择为true的数据呢?
目前代码如下:
Dim dr As List(Of DataRow)= DataTables("业绩管理").SQLSelect("[选择] = 'true'")
If dr.Count > 0 Then
Dim ids As new List(of String)
For Each r As DataRow In dr
ids.Add(r("_Identify"))
Next
Tables("业绩管理").Filter = "[_Identify] in (" & String.Join(",",ids.ToArray) & ")"
Dim Book As New XLS.Book(ProjectPath & "Attachments\标签.xlsx") '打开模板
Dim fl As String = ProjectPath & "Reports\标签.xlsx"
Book.Build() '生成报表
Book.Save(fl)
Dim Proc As New Process
Proc.File = fl
Proc.Start()
Tables("业绩管理").Filter = "" '取消筛选
For Each r As DataRow In DataTables("业绩管理").DataRows
r("选择") = False
r.save
Next
Else
MessageBox.Show("请先选择你需要打印的项目标签,谢谢!","提示",MessageBoxButtons.OK,MessageBoxIcon.Question)
End If