java项目中的列表导出为excel的sql语句怎么写
具体要求如图。用ibatis框架,三个导出只写为一个后台服务。三个判断条件是这样的,sql语句怎么写...
具体要求如图。用ibatis框架,三个导出只写为一个后台服务。三个判断条件是这样的,sql语句怎么写
展开
1个回答
展开全部
给你一段代码,你照着写应该就可以了:
Private Sub Command5_Click()
Dim rs As DAO.Recordset
Dim Filnum As Long
Dim Recnum As Long
Dim xlapp As Object
Set rs = Me.打印价签导出子窗体.Form.Recordset
Set xlapp = CreateObject("excel.application")
xlapp.Visible = True
xlapp.Workbooks.Open ("D:\购好超市\促销及价格管理\标签格式\促销标签打印格式--特价.xlsx")
Dim sheet As Object
Set sheet = xlapp.sheets("内容")
rs.MoveFirst
Recnum = 2
Do Until rs.EOF
For Filnum = 0 To rs.Fields.Count - 1
sheet.cells(Recnum, Filnum + 1) = rs.Fields(Filnum)
Next
Recnum = Recnum + 1
rs.MoveNext
Loop
Set sheet = xlapp.sheets("格式1")
End Sub
Private Sub Command5_Click()
Dim rs As DAO.Recordset
Dim Filnum As Long
Dim Recnum As Long
Dim xlapp As Object
Set rs = Me.打印价签导出子窗体.Form.Recordset
Set xlapp = CreateObject("excel.application")
xlapp.Visible = True
xlapp.Workbooks.Open ("D:\购好超市\促销及价格管理\标签格式\促销标签打印格式--特价.xlsx")
Dim sheet As Object
Set sheet = xlapp.sheets("内容")
rs.MoveFirst
Recnum = 2
Do Until rs.EOF
For Filnum = 0 To rs.Fields.Count - 1
sheet.cells(Recnum, Filnum + 1) = rs.Fields(Filnum)
Next
Recnum = Recnum + 1
rs.MoveNext
Loop
Set sheet = xlapp.sheets("格式1")
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |