Dim dst As Table = Tables("打印_Table1")
Dim clb As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox2")
Dim nbox1 As WinForm.NumericComboBox = e.Form.Controls("NumericComboBox1")
Dim rbt As WinForm.RadioButton = e.Form.Controls("RadioButton1")
Dim dt As DataTable = dst.DataTable
If nbox1.value > dst.DataTable.DataCols.Count Then
msgbox("合并列数不能大于表列数!",64,"提示")
Else
Dim bstr,kkk,kk As String
Dim r,c,i1,i2,i3,m,n,n2,i,rm,rm2,ci As Integer
Dim v As Integer = e.Form.Controls("NumericComboBox2").value '表头高
Dim vv As Integer = e.Form.Controls("NumericComboBox3").value '行高
Dim s,ss,z As String
Dim s2 As String = ""
Dim ss2 As String = "__________"
Dim doc As New PrintDoc '定义一个报表
For i=0 To e.Form.Controls("NumericComboBox4").value-1
Doc.Columns.Add()
Next
Doc.PageSetting.LeftMargin = 10 '设置左边距
Doc.PageSetting.RightMargin = 10 '设置右边距
Doc.PageSetting.TopMargin = 5 '设置上边距
Doc.PageSetting.BottomMargin = 5 '设置下边距
Dim rt As New prt.RenderTable() '定义一个表格对象
rt.Style.Gridlines.All = New prt.Linedef(e.Form.Controls("ColorLabel2").Color) '灰色网格线
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt.Style.Spacing.top = 5 '表格上边距为5
If not e.Form.Controls("CheckBox3").Checked Then
rt.Width = "Auto" '表宽等于各列设置值之和
rt.CanSplitHorz = True '允许表格在水平方向换页
End If
'设置标题
If e.Form.Controls("NumericComboBox4").value <= 1 Then
Dim rs As New prt.RenderText() '定义一个文本对象
rs.Text = e.Form.Controls("TextBox13").value '设置标题
rs.Style.Font = New Font("宋体", 15 , FontStyle.Bold) '设置标题字体
rs.Style.TextAlignHorz = prt.AlignHorzEnum.Center '标题内容水平居中
doc.Body.Children.Add(rs) '将标题对象加入到表格中
End If
doc.Body.Children.Add(rt) '将表格对象加入到报表中
'-----------------------------------------------------------------
If e.Form.Controls("ComboBox6").value ="纵向" OrElse e.Form.Controls("ComboBox6").value = ""
doc.PageSetting.Landscape = False '打印方向
Else
doc.PageSetting.Landscape = True '横向打印方向
End If