此主题相关图片如下:001.jpg
箭头所指两个同类相同数据(数量金额不同),怎样才能将其合并成一行?
直接用报表编辑哦.
在表里执行统计操作生成统计表后再输出报表这个方法太麻烦了...
我的报表代码如下:
Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim tb as Table = Tables("清单")
rt.CanSplitHorz = True
rt.Style.Font = tb.Font
For c As Integer = 0 To tb.Cols.Count -1
rt.Cells(0,c).Text = tb.Cols(c).Name
rt.Cells(0,c).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Cols(c).Width = tb.Cols(c).PrintWidth
If tb.Cols(c).IsNumeric Orelse tb.Cols(c).IsDate Then
rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.Right
End If
For r As integer = 0 To tb.Rows.Count -1
rt.Cells(r + 1, c).Text = tb(r,c)
Next
Next
rt.CellStyle.Spacing.All = 1
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All
doc.Body.Children.Add(rt)
doc.Preview()
出来的效果不太好..此主题相关图片如下:002.jpg
[此贴子已经被作者于2008-12-22 10:55:53编辑过]