以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  book.AddDataTable 如何同时按编号排序呢?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=185084)

--  作者:cnsjroom
--  发布时间:2023/2/3 9:49:00
--  book.AddDataTable 如何同时按编号排序呢?

 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)


--  作者:有点蓝
--  发布时间:2023/2/3 10:04:00
--  
http://www.foxtable.com/webhelp/topics/1397.htm