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


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

主题:分页统计

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


加好友 发短信
等级:超级版主 帖子:107035 积分:544406 威望: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

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


加好友 发短信
等级:超级版主 帖子:107035 积分:544406 威望: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)

 回到顶部
帅哥哟,离线,有人找我吗?
BG小白
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:603 积分:4090 威望:0 精华:0 注册:2019/11/14 23:06:00
  发帖心情 Post By:2021/7/2 18:19:00 [只看该作者]

        For Each dr As DataRow In dt.datarows
            For Each s As String In dr.lines("图片")
                With wb.AddInputGroup("form1","ipg1","商品图片")
                    With .AddUploader("up1","缩略图",True)
                        .AllowAdd = False '关闭文件上传功能
                        .AddImage(s,s)'
                    End With
                End With
            Next
        Next


.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2021.5.29.1
错误所在事件:自定义函数,服装补货查询
详细错误信息:
调用的目标发生了异常。
已添加了具有相同键的项。


 回到顶部
帅哥哟,离线,有人找我吗?
BG小白
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:603 积分:4090 威望:0 精华:0 注册:2019/11/14 23:06:00
  发帖心情 Post By:2021/7/2 19:38:00 [只看该作者]

我在HttpRequest里面添加了
Dim fl As String = "/E:/QYWX/Project/RemoteFiles/" & e.path
Dim path As String = fl.replace("/E:/QYWX/Project/RemoteFiles/" , "")
If FileSys.FileExists(path) Then
    e.WriteFile(path)
End If

所以才用了下面红色部分
        For Each dr As DataRow In dt.datarows
            For Each s As String In dr.lines("图片")
                With wb.AddInputGroup("form1","ipg1","商品图片")
                    s = "/E:/QYWX/Project/RemoteFiles/" & s
                    With .AddUploader("up1","图片",True)
                        .AllowAdd = False '关闭文件上传功能
                        .AddImage(s,s)'
                    End With
                End With
            Next
        Next

 回到顶部
帅哥哟,离线,有人找我吗?
BG小白
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:603 积分:4090 威望:0 精华:0 注册:2019/11/14 23:06:00
  发帖心情 Post By:2021/7/2 19:56:00 [只看该作者]

        For Each dr As DataRow In dt.datarows
            For Each s As String In dr.lines("图片")
                With wb.AddInputGroup("form1","ipg1","商品图片")
                    With .AddUploader("up1","缩略图",True)
                        .AllowAdd = False '关闭文件上传功能
                        .AddImage(s,s)'
                    End With
                End With
            Next
        Next


.NET Framework 版本:4.0.30319.42000
Foxtable 版本:2021.5.29.1
错误所在事件:自定义函数,服装补货查询
详细错误信息:
调用的目标发生了异常。
已添加了具有相同键的项。

而且不知道为什么,如果找不到图片,表内容也不显示了
        With wb.AddTable("","Table1")
            .MergeCols = 3 '合并左边2列
            .Highlight = -1  '关闭高亮显示功能
            .RowHead = 1
            .CreateFromDataTable(dt)
        End With

此主题相关图片如下:43124.png
按此在新窗口浏览图片
正常情况下应该显示

此主题相关图片如下:4314124241.png
按此在新窗口浏览图片

[此贴子已经被作者于2021/7/2 20:46:45编辑过]

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


加好友 发短信
等级:超级版主 帖子:107035 积分:544406 威望: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

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


加好友 发短信
等级:超级版主 帖子:107035 积分:544406 威望: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


 回到顶部
帅哥哟,离线,有人找我吗?
BG小白
  18楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:603 积分:4090 威望:0 精华:0 注册:2019/11/14 23:06:00
  发帖心情 Post By:2021/7/3 18:25:00 [只看该作者]

显示错误哦

图片点击可在新窗口打开查看此主题相关图片如下:82342.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:703182352.png
图片点击可在新窗口打开查看


 回到顶部
帅哥哟,离线,有人找我吗?
BG小白
  19楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:603 积分:4090 威望:0 精华:0 注册:2019/11/14 23:06:00
  发帖心情 Post By:2021/7/3 18:25:00 [只看该作者]

不应该是显示图片的路径吗?

 回到顶部
帅哥哟,离线,有人找我吗?
BG小白
  20楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:603 积分:4090 威望:0 精华:0 注册:2019/11/14 23:06:00
  发帖心情 Post By:2021/7/3 18:49:00 [只看该作者]

我也不知道发生了什么
        With wb.AddInputGroup("form1","ipg1","商品图片")
            wb.AddForm("","form1","test.htm")
            With .AddUploader("up1","",True)
                .AllowAdd = False '关闭文件上传功能
                Dim lstr As new List(of String)
                For Each dr As DataRow In dt.datarows
                    For Each s As String In dr.lines("图片")
                        If lstr.contains(s) Then Continue For
                        lstr.add(s)
                        s = "/E:/QYWX/Project/RemoteFiles/" & s
                        .AddImage(s,s)
                        'msgbox(s)
                    Next
                Next
            End With
        End With

这样写就出来了

        Dim lstr As new List(of String)
        For Each dr As DataRow In dt.datarows
        For Each s As String In dr.lines("图片")
        If lstr.contains(s) Then Continue For
        lstr.add(s)
        With wb.AddInputGroup("form1","ipg1","图片")
        wb.AddForm("","form2","test.htm")
        With .AddUploader("up1","",True)
        s = "/E:/QYWX/Project/RemoteFiles/" & s
        .AllowAdd = False '关闭文件上传功能
        .AddImage(s,s)
        'msgbox(s)
        End With
        End With
        Next
        Next
这样就不出来

 回到顶部
总数 66 上一页 1 2 3 4 5 6 7 下一页