Dim Style As XLS.Style = Book.NewStyle() Style.WordWrap = True '设置单元格自动换行 Style.AlignHorz = XLS.AlignHorzEnum.Center Style.AlignVert = XLS.AlignVertEnum.Center Sheet.Rows(2).Style = Style Sheet.Rows(3).Style = Style Dim m As Integer = ygxm.count Dim n As Integer = cjdm.count Dim zbrq As String zbrq = Format(Date.today,"yyyy年M月d日") Sheet(1,0).value= "报表日期:" & sjrq Sheet(0,0).Value = "中国建设银行保定东风中路支行公司机构客户数量情况表[按客户经理及客户分层]" Sheet(2,0).Value = "员工编号" Sheet(2,1).Value = "员工姓名" Sheet(m+5,1).Value = "合计" For i As Integer = 0 To ygxm.Count - 1 For j As Integer = 0 To cjdm.Count - 1 Sheet(i + 5, 0).Value = ygbh(i) Sheet(i + 5, 1).Value = ygxm(i) Sheet(2, j + 2).Value = cjdm(j) Sheet(3, j + 2).Value = cj(j)(1) Sheet(4, j + 2).Value = cj(j)(2) Dim jqsl,bgqsl,jqslhj,bgqslhj As Integer jqsl=gsjgkhsjb.Compute("Count(客户有效性代码)","客户经理_原_姓名 = '" & ygxm(i) & "' And 客户有效性代码 = '" & cjdm(j) & "' And 数据日期= '"& sjrq &"'") ''bgqsl=gsjgkhsjb.Compute("Count(客户有效性代码)","客户经理_姓名 = '" & ygxm(i) & "' And [客户有效性代码] = '" & cjdm(j) & "'And 数据日期= '"& bgqrq &"'") 'jqslhj=gsjgkhsjb.Compute("Count(客户有效性代码)","[客户有效性代码] = '" & cjdm(j) & "'And 数据日期= '"& sjrq &"'") ''bgqslhj=gsjgkhsjb.Compute("Count(客户有效性代码)","[客户有效性代码] = '" & cjdm(j) & "'And 数据日期= '"& bgqrq &"'") Sheet(i + 5, j + 2).Value = jqsl 'Sheet(i + 4, n + j + 2).Value = gsjgkhsjb.Compute("Count(客户有效性代码)","客户经理_姓名 = '" & ygxm(i) & "' And [客户有效性代码] = '" & cjdm(j) & "'And 数据日期= '"& bgqrq &"'") ' Sheet(m + 5, j + 2).Value = jqslhj Next Next Sheet.MergeCell(0,0,1,n+2) Sheet.MergeCell(1,0,1,n+2) Sheet.MergeCell(2,0,3,1) Sheet.MergeCell(2,1,3,1) Sheet(m+7, n-3).Value = "制表人:" & User.Name Sheet(m+7, n-1).Value = "制表日期:" & zbrq Forms("进度显示").close '打开工作簿 Book.Save("\\Bddfzlzh-kh\中国建设银行绩效考核系统$\EXCEL报表\客户相关报表\公司机构客户数量表【按客户经理及客户分层】" & sjrq & ".xls") '("d:\data\文件.csv",
|