--
谢谢老师回答,是下面这段合并代码导致的 我把合并代码注释就可以了
请问一下为什么下面这段代码 如果合并列包含 _ 的就显示不正确 请问我要怎么修改这段代码?
Dim dr As DataRow =DataTables("查询配置表").SQLfind("窗口名称=\'" & _ckmc & "\' ")
If dr IsNot Nothing Then
Dim ss As String =dr("合并列")
Dim qx As WinForm.Button = Forms(_ckmc).Controls("取消合并")
qx.PerformClick
Dim tb As Table = Tables(_ckmc & "_table1")
Dim Names As New List(Of String)
For Each r As Row In tb.Rows
If Names.Contains(r("单据编号"))= False Then
Names.Add(r("单据编号"))
End If
Next
Dim i As Integer
Dim j As Integer
For Each r As Row In tb.Rows
i= tb.DataTable.Compute("count(单据编号)"," 单据编号= \'" & r("单据编号") & "\'")
If Names.Contains(r("单据编号"))= True Then
Names.Remove(r("单据编号"))
j= r.Index +1
For x As Integer = 1 To tb.Cols.Count
Dim rc As Col =tb.Cols(x-1)
If ss.Contains(rc.Name)=True Then
Dim a As Integer = j
Dim b As Integer = x
Dim c As Integer = i+j-1
Dim d As Integer = x
tb.Grid.AllowMerging = C1.Win.C1FlexGrid.AllowMergingEnum.Custom
Dim rng As C1.Win.C1FlexGrid.CellRange = tb.Grid.GetCellRange(a,b,c,d)
tb.Grid.MergedRanges.Add(rng)
End If
Next
End If
If names.Count = 0 Then
Exit For
End If
Next
End If
[此贴子已经被作者于2017/8/1 17:08:24编辑过]