Dim filter As String = " 年度 = '" & e.DataRow("年度") & "' And 期间 = '" & e.DataRow("期间") & "'And 公司名称 = '" & e.DataRow("公司名称") & "'And 部门编号 = '" & e.DataRow("部门编号") & "'" Select Case e.DataCol.name Case "上年同期","本期金额" If val(e.DataRow("上年同期")) <> 0 Then e.DataRow("增减率") = Format((val(e.DataRow("本期金额")) - val(e.DataRow("上年同期"))) / val(e.DataRow("上年同期")),"0.00%") End If Case "年度","期间" Dim drzb01 As DataRow = e.DataTable.find(filter & " and 指标名称 = '总医疗费用(万元)'") If drzb01 IsNot Nothing Then drzb01("本期金额") = DataTables("门诊收入预算").Compute("sum(金额)",filter & " And (收入明细 like '%合计%' )") End If Dim drzb02 As DataRow = e.DataTable.find(filter & " and 指标名称 = '检查占总收入比例'") If drzb02 IsNot Nothing AndAlso DataTables("门诊收入预算").Compute("sum(金额)",filter & " And (收入明细 like '%合计%' )") <> 0 Then drzb02("本期金额") = Format(DataTables("门诊收入预算").Compute("sum(金额)",filter & " And 收入明细 like '%合计%' and 项目 = '检查收入'")/DataTables("门诊收入预算").Compute("sum(金额)",filter & " And (收入明细 like '%合计%' )"),"Percent") End If End Select
|