加好友 发短信
等级:贵宾
帖子:39310
积分:196782
威望:0
精华:1
注册:2015/4/25 9:23:00
|
Post By:2015/5/3 20:45:00 [显示全部帖子]
加入判断即可,比如
Dim doc As PrintDoc = e.Form.GernatePrintDoc() Dim d As Date For Each c As object In Doc.Body.Children If c.Gettype.Name Like "*Table*" Then Dim t As prt.RenderTable = c t.Rows(0).Height = 10 t.Rows(0).Style.BackColor = Color.white t.Rows(0).Style.Font = New Font("宋体", 12, FontStyle.Bold) '设置字体 For i As Integer = 0 To t.Cols.Count - 1 t.Cells(0,i).Style.TextAlignHorz = prt.AlignHorzEnum.Center Next Else If c.Gettype.name Like "*Text*" AndAlso Date.TryParse(c.text,d) Then If c.Text.Length < 11 Then c.text = Format(cdate(c.text), "yyyy年MM月dd日") Else c.text = Format(cdate(c.text), "yyyy年MM月dd日 HH时mm分dd秒") End If End If Next doc.Preview
|
|