Foxtable(狐表)用户栏目专家坐堂 → 相同的第一列如何合并成一个单元格?


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

主题:相同的第一列如何合并成一个单元格?

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


加好友 发短信
等级:超级版主 帖子:110738 积分:563610 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/6/21 20:36:00 [显示全部帖子]

……
rt.cells(0,2).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.cells(0,3).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.cells(0,4).Style.TextAlignHorz = prt.AlignHorzEnum.Center 
For Each pd As String In Regions
    drs = tbl.DataTable.Select("[线路] = '" & pd & "'","序号")
    Dim m As Integer = drs.count '记录每条线路的行数
cnt = rt.Rows.Count+1 '报表总行数
    For Each dr As DataRow In drs
        For c As Integer = 1 To ColNames.Length - 1
            If tbl.Cols(ColNames(c)).IsNumeric  Then
                If dr(ColNames(c)) <> 0 Then
                    rt.Cells(cnt, c).Text = Format(dr(tbl.Cols(ColNames(c)).Name),"0.0")
                    rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.Right
                End If
            Else
                rt.Cells(cnt, c).Text = dr(tbl.Cols(ColNames(c)).Name)
                rt.Cols(c).Style.TextAlignHorz = prt.AlignHorzEnum.center
            End If
        Next
cnt += 1
    Next
rt.Cells(cnt-m,0).SpanRows = m 
rt.Cells(cnt -m , 0).Text = pd
cnt += 1
    rt.Cells(cnt, 0).Text = "小计 " & pd    
    rt.Cells(cnt,2).Text = Format(tbl.compute("Sum(纸币)", "线路 = '" & pd & "'"),"0.0")
    rt.Cells(cnt,3).Text = Format(tbl.compute("Sum(硬币)", "线路 = '" & pd & "'"),"0.0")
    rt.Cells(cnt,4).Text = Format(tbl.compute("Sum(金额)", "线路 = '" & pd & "'"),"0.0")
    rt.Cells(cnt,0).SpanCols = 2 
Next
cnt = rt.Rows.Count
rt.Cells(cnt, 0).Text = "合计 " '打印合计
……

 回到顶部