Dim doc As New PrintDoc '定义一个报表
Dim rt As New prt.RenderText '定义一个文本对象
rt.Text = "常德市疾病预防控制中心考勤情况 通 报" & Vbcrlf & Vbcrlf '设置文本对象的内容
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.Font = New Font("宋体", 20, FontStyle.Bold)
rt.Style.LineSpacing = 200 '设置双倍行距
doc.Body.Children.Add(rt)
Dim ddr As Row = Tables("统计表1").Current
If ddr IsNot Nothing Then
Dim rt1 As New prt.RenderText '定义一个文本对象
rt1.Style.Font = New Font("宋体", 14)
rt1.Style.LineSpacing = 200 '设置双倍行距
Dim s As String
s = s & ddr("姓名") & ":" & Vbcrlf
s = s & " 根据中心考勤管理系统数据统计,你" & Date.Today.Year & "年" & ddr("月") & "月的考勤情况如下:" & Vbcrlf
Dim ss As String
Dim drrs As List(of DataRow) = DataTables("微信打卡").Select("迟到次数 > 0")
If drrs.Count > 0 Then
For Each drr As DataRow In drrs
ss = drr("日期") & ";" & ss
Next
s = s & " 迟到:" & ddr("迟到次数") & "次。具体时间:" & ss & vbcrlf
End If
Dim sss As String
Dim drrrs As List(of DataRow) = DataTables("微信打卡").Select("缺卡次数 > 0")
For Each drrr As DataRow In drrrs
sss = drrr("日期") & ";" & sss
Next
If drrrs.Count > 0 Then
s = s & " 缺卡:" & ddr("缺卡次数") & "次。具体时间:" & sss & vbcrlf
End If
Dim ssss As String
Dim drrrrs As List(of DataRow) = DataTables("表B").Select("缺卡次数 = 2")
For Each drrrr As DataRow In drrrrs
ssss = drrrr("日期") & ";" & ssss
Next
If drrrrs.Count > 0 Then
s = s & " 旷工:" & ddr("旷工天数") & "天。具体时间:" & ssss & vbcrlf
End If
s = s & " 根据中心《劳动纪律管理制度》,扣除绩效考核分" & ddr("扣分") & "分。希望你能加强自我约束、自我管理,严格遵守劳动纪律,类似情况不再发生。" & Vbcrlf
s = s & " 特此通报!" & Vbcrlf & Vbcrlf & Vbcrlf & Vbcrlf
s = s & " 常德市疾病预防控制中心监察室" & vbcrlf
s = s & " " & Date.Today.Year & "年" & Date.Today.Month & "月" & Date.Today.Day & "日 "
rt1.Text = s
doc.Body.Children.Add(rt1) '将文本对象加入到报表
doc.Preview() '预览
End If
[此贴子已经被作者于2020/11/22 21:56:34编辑过]