Foxtable(狐表)用户栏目专家坐堂 → 分页统计


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

主题:分页统计

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


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

按国家做条件显示数据呗,比如一次只显示一个国家的数据,或者显示2、3个国家的数据

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


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

没看懂,请上传实例说明。原数据是怎么样的,下一款又是哪些数据

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


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

利用集合
全局代码
public lst as new List(of string)

afteropenproject
lst = datatables("表A").getvalues("商品代码")

第一页就是提取集合为0的索引作为查询条件,把集合索引作为页码保存即可
Dim page As Integer = 0
dim filter as string = "商品代码='" & lst(page) & "'"



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


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

先看看:http://www.foxtable.com/mobilehelp/topics/0044.htm

去掉这句: s = "/E:/QYWX/Project/RemoteFiles/" & s

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


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

……
        Else '否则根据Cookie合成条件表达式
            If e.Cookies.ContainsKey("product") Then
                flt = "bh = '" & e.Cookies("product") & "'"
            End If
        End If
        
Dim page As Integer = 0
        If e.GetValues.ContainsKey("page") Then  '如果地址中有page参数
            Integer.TryParse(e.GetValues("page"), page) '提取page参数
        End If
        Dim cmd As New SQLCommand
        cmd.C '记得设置数据源名称
        cmd.CommandText = "Select Row_Number() Over(Order by SPDM) As [NO.], SPDM as 商品代码,ZJF AS 助记符,CW AS  仓位,GG1MC as 颜色,GG2MC as 尺码,BHS AS 补货数,TCTP AS 图片 From XPHCX where SPDM='" & lst(page) & "' "
        If flt > "" Then
            cmd.CommandText = cmd.CommandText & " and " & flt
        End If
        Dim dt As DataTable = cmd.ExecuteReader
        With wb.AddTable("","Table1")
            .MergeCols = 3 '合并左边2列
            .Highlight = -1  '关闭高亮显示功能
            .RowHead = 1
            .CreateFromDataTable(dt)
        End With
        With wb.AddInputGroup("form1","ipg1","商品图片")
        wb.AddForm("","form2","test.htm")
        With .AddUploader("up1","",True)
        .AllowAdd = False '关闭文件上传功能
        For Each dr As DataRow In dt.datarows
        For Each s As String In dr.lines("图片")
        AddImage(s)
        'msgbox(s)
        Next
        Next
        End With
        End With
        
        With wb.AddButtonGroup("","btg2", False)
            If page > 0 Then
                .Add("btnPrev", "上一款","","List.htm?page=" & page - 1)
            End If
            If page < lst.count - 1 Then
                .Add("btnNext", "下一款","","List.htm?page=" & page + 1)
            End If
        End With
End Select

e.WriteString(wb.Build)

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


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

红色代码完全多余的,原因请认真看看:http://www.foxtable.com/mobilehelp/topics/0044.htm

错误的原因是有重复的图片名称,可以利用集合判断一下

dim lst as new list(of string)
       For Each dr As DataRow In dt.datarows
            For Each s As String In dr.lines("图片")
if lst.contains(s) then continue for
lst.add(s)
                With wb.AddInputGroup("form1","ipg1","商品图片")
                    With .AddUploader("up1","缩略图",True)
                        .AllowAdd = False '关闭文件上传功能
                        .AddImage(s,s)'
                    End With
                End With
            Next
        Next

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


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

另外自己调试一下

Dim fl As String = "/E:/QYWX/Project/RemoteFiles/" & e.path
msgbox(fl)
Dim path As String = fl.replace("/E:/QYWX/Project/RemoteFiles/" , "")
msgbox(path)
If FileSys.FileExists(path) Then
    e.WriteFile(path)
End If


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


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

Case "list.htm"这个页面的代码不完整,看不出什么问题

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


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

        Dim flt As String
        If e.GetValues.ContainsKey("unfilter") Then '如果有unfilter参数,则清除cookie
MessageBox.Show(e.GetValues("unfilter"))
            wb.ClearCookie()
        ElseIf e.PostValues.Count > 0 Then '如果是filter.htm访问,则根据用户输入合成条件表达式
            If e.PostValues.ContainsKey("product") Then
                flt = "bh = '" & e.PostValues("product") & "'" '合成条件
                wb.AppendCookie("product", e.PostValues("product")) '将值写入cookie中
            Else
                wb.DeleteCookie("product") '删除cookie
MessageBox.Show(删除cookie 
            End If
        Else '否则根据Cookie合成条件表达式
MessageBox.Show(根据cookie” 
            If e.Cookies.ContainsKey("product") Then
                flt = "bh = '" & e.Cookies("product") & "'"
            End If
        End If
MessageBox.Show(flt 
        MessageBox.Show(e.PostValues("product"))

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


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

点击查询?还是点击下一个弹出来的,能不能自己把问题描述清楚

 回到顶部
总数 22 1 2 3 下一页