Dim Doc As New PrintDoc doc.PageSetting.PaperKind = 9 '设定为A4纸 Doc.PageSetting.RightMargin = 5 '设置右边距 doc.AutoRotate = False '禁止自动旋转打印内容 Doc.PrinterName = "IBM Proprinter X24" doc.Style.FontSize = 14 Doc.Style.F Dim rx As prt.RenderText Dim x As Integer = 0 '定义水平偏移参数 Dim y As Integer = 0 '定义垂直偏移参数 Dim g As Integer = 0 '定义不同月末的垂直偏移参数 Dim CurRow As Row = Tables("病案打印").Current Dim cnt As Integer For i As Integer = Tables("病案打印.病程记录").TopPosition To Tables("病案打印.病程记录").BottomPosition Dim CurRow6 As Row = Tables("病案打印.病程记录").Rows(i) cnt = cnt + 1 Select Case CurRow6("记录类型") Case "三月末","六月末" g = 0 Case "四月末","七月末" g = 88 Case "五月末","八月末" g = 177 Case "一月末" g = 132 Case "二月末" g = 176 End Select Dim ra As New prt.RenderArea '定义一个容器 ra.x = 20 + x ra.y = 32 + y * cnt + g rx = new prt.RenderText rx.Text = CurRow6("记录时间").Date rx.Style.Spacing.Bottom = 6 ra.Children.Add(rx)