2、
Dim doc As PrintDoc = e.Form.GernatePrintDoc()
For Each c As Object In doc.body.children
If typeof c Is prt.Rendertable Then
'c.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center
'c.Rows(0).style.TextAlignVert = prt.AlignVertEnum.Center
For i As Integer = 0 To c.Cols.Count - 1
c.cols(i).Style.TextAlignHorz = prt.AlignHorzEnum.Center
c.cols(i).style.TextAlignVert = prt.AlignVertEnum.Center
Next
End If
Next
doc.Preview()
老师,cols(i)效果只从第二行开始出现。 换了Rows(0)就没半点反应呢,要怎么样才能现实首行居中呢。
c.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center
c.Rows(0).style.TextAlignVert = prt.AlignVertEnum.Center