以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  移动表 怎么增加一个序号列  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=123606)

--  作者:yifan3429
--  发布时间:2018/8/19 9:56:00
--  移动表 怎么增加一个序号列
  With wb.AddTable("","Table1")
                    .Alternate = 3
                    Dim nms() As String = {"报备人","用户姓名","楼盘","单元房号","客户等级","用户电话","用户微信","户型" ,"状态"}
                    .Head.AddRow(nms)
                    For Each r As DataRow In DataTables("终端用户").sqlSelect("[部门] = \'" & bm & "\'", "", "日期 Desc")
                        With .Body.AddRow(r("报备人"),r("用户姓名"),r("楼盘"),r("单元房号"),r("客户等级"),"<a href=\'tel:" & r("用户电话") & "\'>" & r("用户电话") & "</a>",r("用户微信"),r("户型"),r("状态"))
                            \'.AddCell(Format(r("日期"),"MM月dd日"))
                        End With
                    Next
                End With
                e.WriteString(wb.Build)
                \'-----------------------------------------------------------------------------------
            End If
        End If
End Select

--  作者:有点蓝
--  发布时间:2018/8/19 10:05:00
--  
参考:http://www.foxtable.com/mobilehelp/scr/0066.htm

或者
With wb.AddTable("","Table1")
    .Alternate = 3
    Dim nms() As String = {"序号","报备人","用户姓名","楼盘","单元房号","客户等级","用户电话","用户微信","户型" ,"状态"}
    .Head.AddRow(nms)
    Dim idx As Integer = 1
    For Each r As DataRow In DataTables("终端用户").sqlSelect("[部门] = \'" & bm & "\'", "", "日期 Desc")
        With .Body.AddRow(idx,r("报备人"),r("用户姓名"),r("楼盘"),r("单元房号"),r("客户等级"),"<a href=\'tel:" & r("用户电话") & "\'>" & r("用户电话") & "</a>",r("用户微信"),r("户型"),r("状态"))
            \'.AddCell(Format(r("日期"),"MM月dd日"))
        End With
        idx+= 1
    Next
End With