以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  请教:表格做附表的时候,列能不能固定一个宽度值?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=30751)

--  作者:qq469000995
--  发布时间:2013/4/2 22:06:00
--  请教:表格做附表的时候,列能不能固定一个宽度值?

请教大侠:

   在做表格筛选的时候,附表的值不能安照本人的意思的宽度出来,不知道能不能弄个固定的,如下一个代码

 

Dim t As Table =Tables("工作页_Table1")
Dim py,Lm,Ts, Bm,sql,Lb,sl As String
Dim Ls As New List(Of Integer)
Dim Lss As New List(Of String)
Static st As String

Dim drs As New List(of DataRow)                        \'定义一个DataRow行的集合
Ts = "公司名称,合同项目,签订日期"                                    \'查询相关列
Bm = "_2013年合同"
If st = e.sender.Text.ToUpper Then
    Return
Else
   st = e.sender.Text.ToUpper
End If   
e.sender.Text =  st
Sendkeys.Send("^{END}")                                    \'光标定于输入框最后

drs = DataTables(Bm).Select("公司名称> \'\'")
\'赋值drs=员工表--姓名列不为空的 DataRow行
If drs.count > 0 Then                                             \'如drs行数>0,执行...
    If st IsNot Nothing Then                                    \'如输入框内容不为空,执行...
        For Each Lm In Ts.split(",")                            \'遍历查询相关列
            For Each dr As DataRow In drs                   \'遍历所有行
                py = GetPY(dr(Lm),True)                       \'赋值py = 查询行查询列的简拼
                If dr(Lm).IndexOf(st)> -1 OrElse py.IndexOf(st) > -1 Then
                                                                              \'如查询行查询列内容(或简拼)包含输入框内容,执行...
                    If Ls.Contains(dr("_Identify")) = False Then    \'如不包含则增加
                        ls.Add(dr("_Identify"))
                    End If                  
                    If Lss.Contains(dr(Lm)) = False Then
                        Lss.Add(dr(Lm))
                    End If
                   
                End If
            Next
        Next
        If Ls.count > 0 Then
            For Each n As Integer In Ls
                sql+ = ","  & n                                                            
            Next
            sql = "[_Identify] In(" & sql.Trim(",") & ")"                            \'包含主键[_Identify]内容
            sql = "select " & Ts & " from{" & Bm & "} where " & sql          \'合成SQL语句
            t.Fill(sql,True)                                                                    \'生成SQL查询表
            For Each sl In Lss
                lb+ = "|"  & sl
            Next                                                     \'形成输入框列表       
        End If     
    End If
End If

 

 

因为公司名称比较长,但是表格出来列宽很短,名字显示不全,可不可以解决的?

可以的话,在哪里加代码的?