有色部分是分栏打印部分,整合成左单右双,分两栏的模式,如图
rt.Rows(rt.Rows.Count).Height = 7
rt.Rows(rt.Rows.Count-1).Style.GridLines.Top = New prt.Linedef(0.2,clr)
rt.Rows(rt.Rows.Count-1).Style.TextColor = clr
rt.Rows(rt.Rows.Count-1).Style.Font = New Font("黑体", 10, FontStyle.Regular)
rt.Cells(rt.Rows.Count-1,0).SpanCols = 2 '向右合并2列
rt.Cells(rt.Rows.Count-1,0).Text = "考试日期"
rt.Cells(rt.Rows.Count-1,2).Text = "考试时间"
rt.Cells(rt.Rows.Count-1,3).Text = "试卷"
rt.Cells(rt.Rows.Count-1,4).SpanCols = 3 '向右合并2列
rt.Cells(rt.Rows.Count-1,4).Text = "课 程"
rt.Cells(rt.Rows.Count-1,7).Text = "考试方式"
rt.Cells(rt.Rows.Count-1,8).SpanCols = 2 '向右合并2列
rt.Cells(rt.Rows.Count-1,8).Text = "考场号"
rt.Cells(rt.Rows.Count-1,10).SpanCols = 2 '向右合并2列
rt.Cells(rt.Rows.Count-1,10).Text = "座位号"
rt.Cells(rt.Rows.Count-1,12).SpanCols = 4 '向右合并2列
rt.Cells(rt.Rows.Count-1,12).Text = "考 室"
rt.Cells(rt.Rows.Count-1,0).Style.GridLines.left = New prt.Linedef(0.5,clr)
rt.Cells(rt.Rows.Count-1,12).Style.GridLines.Right = New prt.Linedef(0.5,clr)
drs = DataTables("bbs").Select("buser = '" & dr("suser") & "'","btype,bresult")
cnt = drs.Count
mxh = Math.Max(35,cnt)
Dim xuhao As Integer = 1
Dim pdr As DataRow
dt.DataRows.Clear
If i Mod 2 = 1 Then
pdr = dt.AddNew
pdr("sid") = i
pdr("sname") = dr("sname")
pdr("suser") = dr("suser")
Else
pdr("sid1") = i
pdr("sname1") = dr("sname")
pdr("suser1") = dr("suser")
End If
Next
For i As Integer = 0 To mxh - 1
rt.Rows(rt.Rows.Count).Height = 5
rt.Rows(rt.Rows.Count-1).Style.Font = New Font("宋体", 10, FontStyle.Regular)
rt.Cells(rt.Rows.Count-1,0).SpanCols = 2 '向右合并2列
rt.Cells(rt.Rows.Count-1,4).SpanCols = 3 '向右合并2列
rt.Cells(rt.Rows.Count-1,8).SpanCols = 2 '向右合并2列
rt.Cells(rt.Rows.Count-1,10).SpanCols = 2 '向右合并2列
rt.Cells(rt.Rows.Count-1,12).SpanCols = 4 '向右合并2列
rt.Cells(rt.Rows.Count-1,0).Style.GridLines.left = New prt.Linedef(0.5,clr)
rt.Cells(rt.Rows.Count-1,12).Style.GridLines.Right = New prt.Linedef(0.5,clr)
If i < cnt
rt.Cells(rt.Rows.Count-1,3).Text = drs(i)("bresult")
'rt.Cells(rt.Rows.Count-1,8).Text = drs(i)("考场号")
'rt.Cells(rt.Rows.Count-1,10).Text = drs(i)("座位号")
Dim dr1 As DataRow = DataTables("ksap").find("sub_id = '" & drs(i)("sub_id") & "'")
If dr1 IsNot Nothing
'rt.Cells(rt.Rows.Count-1,0).Text = format(dr1("btype"),"yyyy-MM-dd").Replace("0001-01-01","")
rt.Cells(rt.Rows.Count-1,0).Text = xuhao
xuhao = xuhao+1
rt.Cells(rt.Rows.Count-1,2).Text = dr1("szmc")
'rt.Cells(rt.Rows.Count-1,3).Text = dr1("sub_id")
rt.Cells(rt.Rows.Count-1,4).Text = dr1("sj")
rt.Cells(rt.Rows.Count-1,7).Text = dr1("kslx")
rt.Cells(rt.Rows.Count-1,12).Text =dr1("ks")
End If
End If
Next
此主题相关图片如下:hl8tw1n)q0~vadq(xy@fl7.png
[此贴子已经被作者于2016/10/31 21:52:27编辑过]