Foxtable(狐表)用户栏目专家坐堂 → 请教专业报表的合并单元格。


  共有9786人关注过本帖树形打印复制链接

主题:请教专业报表的合并单元格。

帅哥哟,离线,有人找我吗?
lin_hailun
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:6708 积分:34304 威望:0 精华:11 注册:2012/8/18 23:10:00
  发帖心情 Post By:2012/11/19 13:11:00 [显示全部帖子]

 '''
'********报表************
Dim doc As New Printdoc
'报表内容
Dim rt As  prt.RenderTable
rt = New prt.RenderTable
rt.Style.GridLines.All = prt.Linedef.Default '网格线为默认类型
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '设置字体居中
rt.CellStyle.Spacing.All = 1  '行与行之间的间隔
'------------------------------------------------------------------------------------------------------------------------------
Dim dr As Row =Tables("原始记录分类.原始记录three").current
Dim ycfn As String = dr("分类序号")

Dim tb As DataTable = DataTables("原始记录")
Dim tbrows As List(of DataRow) = tb.Select("[受理编号] = '" & dr("受理编号") & "' and [分类序号] =  '" & ycfn  & "'", "采样地点")

rt.Cells(0,0).Text = "采样地点"
rt.Cells(0,1).Text = "检验项目"
rt.Cells(0,2).Text = "测定值(ug/L)"
rt.Cells(0,3).Text = "报告值(mg/L)"

rt.Cells(1,0).Text = tbrows(0)("采样地点")
rt.Cells(1,1).Text = tbrows(0)("检验项目")

Dim FirstRow As Integer = 1
For bci As Integer = 1 To tbrows.count -1
    
    If tbrows(bci)("采样地点") = tbrows(bci -1)("采样地点")    Then
        rt.Cells(firstRow,0).SpanRows = rt.Cells(firstRow, 0).SpanRows + 1
        rt.Cells(bci+1,1).Text = tbrows(bci)("检验项目")
    Else
        rt.Cells(bci+1,0).Text = tbrows(bci)("采样地点")
        rt.Cells(bci+1,1).Text = tbrows(bci)("检验项目")
        rt.Cells(bci+1,0).SpanRows = 1
        firstRow = bci+1
    End If
Next
doc.Body.Children.Add(rt)
'---------------------------------------------------------------------------------------------------------------------

doc.Preview()

 回到顶部