Foxtable(狐表)用户栏目专家坐堂 → 数据筛选改成Excel报表


  共有2572人关注过本帖树形打印复制链接

主题:数据筛选改成Excel报表

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 15:04:00 [显示全部帖子]

参考:http://www.foxtable.com/mobilehelp/topics/0148.htm

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 15:16:00 [显示全部帖子]

一样的用法,把上面的sql放到生成报表的book.AddDataTable

book.AddDataTable("员工","数据源名称","select 年,月,店名汉字,姓名,职务店铺,职务其它,AB组,基本工资,上班天数,上班基本工资 From 工资明细表 where " & flt) 

 回到顶部
帅哥,在线噢!
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 15:45:00 [显示全部帖子]

Dim Book As New XLS.Book(ProjectPath & "Attachments\工资条.xls")
Dim fl As String = ProjectPath & "Reports\工资条.xls"
book.AddDataTable("工资明细表","KPRJ","select 年,月,店名汉字,姓名,职务店铺,职务其它,AB组,基本工资,上班天数,上班基本工资 From 工资明细表 where " & flt) 
Book.Build() 
Book.Save(fl)

 回到顶部
帅哥,在线噢!
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 16:22:00 [显示全部帖子]

参考:http://www.foxtable.com/mobilehelp/topics/0148.htm

 回到顶部
帅哥,在线噢!
有点蓝
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 16:50:00 [显示全部帖子]

那要转换为网页,参考这种:http://www.foxtable.com/mobilehelp/topics/0288.htm

 回到顶部
帅哥,在线噢!
有点蓝
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 17:16:00 [显示全部帖子]

If e.Path.StartsWith("Reports\")
    e.Resp
    Select Case e.Path
        Case  "Reports\list.htm"
            Dim flt As String
            If e.PostValues.ContainsKey("product") Then
                flt = "姓名 = '" & e.PostValues("product") & "'"
            End If
            If e.PostValues.ContainsKey("product1") Then
                If flt > "" Then
                    flt = flt & " and "
                End If
                flt = flt & "年 = '" & e.PostValues("product1") & "'"
            End If
            If e.PostValues.ContainsKey("product2") Then
                If flt > "" Then
                    flt = flt & " and "
                End If
                flt = flt & "月 = '" & e.PostValues("product2") & "'"
            End If
            Dim Book As New XLS.Book(ProjectPath & "Attachments\工资条.xls")
            book.AddDataTable("工资明细表","KPRJ","select * From 工资明细表 where " & flt)
            e.WriteBookAsPDF(Book)
        Case Else
            e.AsReportServer("Reports\")
    End Select
Else
    Select Case e.Path
        Case "filter.htm"
            wb.AddForm("","form1","Reports/list.htm")
            With wb.AddInputGroup("form1","ipg1","数据筛选")
                
                
                Dim bh As String = e.Cookies("username")
                Dim bh2 As String = "[" & e.Cookies("username") & "]"
                
                Dim ddr1 As DataRow= DataTables("Users").SQLFind("Name='"& e.Cookies("username")  &"' " )
                If ddr1 IsNot Nothing AndAlso ddr("Group") = "管理"
                    
                    Dim sl2 As String = "|" & DataTables("Users").SQLGetComboListString("Name") & "|"
                    sl2 = sl2.replace(bh,bh2).TrimEnd("|")
                    .AddSelect("product","用户姓名",sl2 )
                Else
                    .AddSelect("product","用户姓名",bh2 )
                End If
                
                Dim sl3 As String = "" & DataTables("工资明细表").SQLGetComboListString("年") & ""
                .AddSelect("product1","年",sl3 )
                
                Dim sl4 As String = "" & DataTables("工资明细表").SQLGetComboListString("月") & ""
                .AddSelect("product2","月",sl4 )
                
                
            End With
            With wb.AddButtonGroup("form1","btg1",True)
                .Add("btn1", "确定", "Reports\jianli.htm")
                .Add("btn2","返回", "","default.htm") '退出登录
            End With
            
            e.WriteString(wb.Build) '生成网页
    End Select
End If


 回到顶部
帅哥,在线噢!
有点蓝
  7楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 17:37:00 [显示全部帖子]

服务器没有安装office。安装2010及以上的版本

 回到顶部
帅哥,在线噢!
有点蓝
  8楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106688 积分:542635 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2021/7/20 20:34:00 [显示全部帖子]

 不行的 

 回到顶部