book.AddDataTable 如何同时按编号排序呢?麻烦老师帮忙看看 谢谢!
在生成表数据之前,进行一次按编号进行升序排列
当前代码如下:
Dim e As RequestEventArgs = rq.e
Dim dt1 As Date=e.Values("开始日期")
Dim dt2 As Date=e.Values("结束日期")
Dim time As String =Format(Date.now,"yyyyMMddHHmmss")
Dim Book As New XLS.Book(ProjectPath & "Attachments\台账.xls") '打开模板
Dim fl As String = ProjectPath & "Reports\" & dt1.Year & "台账" & time &".xls"
Dim Sheet As XLS.Sheet = Book.Sheets(0)
book.AddDataTable("台账","主数据源","Sele ct * from {台账} where 时间 >= '" & dt1 & "' And 时间 <= '" & dt2 & "'")
End if
Book.Build() '生成报表
Book.Save(fl)