Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
哪位老师帮我看看如下公式,我想让前六列(按照第一列内容 "工作号" 相同) 相同内容合并,公式不会做.
For c As Integer = 0 To tb.Cols.Count -1
Dim FirstRow As Integer = 1
For r As integer = 0 To tb.Rows.Count -1
If tb(r,c) Is Nothing Then
Continue for
End if
If r > 0 AndAlso tb.Cols(c).IsString AndAlso tb(r,c) = tb(r - 1,c) Then
rt.Cells(FirstRow,c).SpanRows = rt.Cells(FirstRow,c).SpanRows + 1
Else
rt.Cells(r + 1, c).Text = tb(r,c)
FirstRow = r + 1
End if
Next
Next
看红色部分
Dim doc As New PrintDoc
Dim tb as Table = Tables("表A")
Dim rt As New prt.RenderTable() '定义一个表格对象
Dim ColNames As New List(Of String)
For Each cl As Col In tb.Cols '排除隐藏列
If cl.Visible Then
ColNames.Add(cl.Name)
End If
Next
rt.Style.GridLines.All = New prt.Linedef '设置网格线
For c As Integer = 0 To tb.Cols.Count -1
Dim FirstRow As Integer = 1
For r As integer = 0 To tb.Rows.Count -1
If tb(r,c) Is Nothing Then
Continue for
End if
If r > 0 AndAlso c <= 5 AndAlso tb.Cols(c).IsString AndAlso tb(r,c) = tb(r-1,c) Then
rt.Cells(FirstRow,c).SpanRows = rt.Cells(FirstRow,c).SpanRows + 1
Else
rt.Cells(r + 1, c).Text = tb(r,c)
FirstRow = r + 1
End if
Next
Next
doc.Body.Children.Add(rt) '将表格对象加入到报表中
doc.Preview()
感谢MING姐,我试试