以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]报表打印中公式问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=92218) |
||||
-- 作者:大雪山 -- 发布时间:2016/10/29 1:00:00 -- [求助]报表打印中公式问题
写的代码出错,想给报表中第二列序号自动加1 2 3.....,请老师修改指点一下.
\'rt.Cells(rt.Rows.Count-1,2).Text = dr1("sj")
|
||||
-- 作者:有点蓝 -- 发布时间:2016/10/29 9:25:00 -- 报表输出,直接设置报表就好,没有必要再去动表格 ...... cnt = drs.Count mxh = Math.Max(10,cnt) Dim xuhao As Integer = 1 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)("szh") 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("szh = \'" & drs(i)("szh") & "\'") If dr1 IsNot Nothing rt.Cells(rt.Rows.Count-1,0).Text = format(dr1("rq"),"yyyy-MM-dd").Replace("0001-01-01","") rt.Cells(rt.Rows.Count-1,2).Text = xuhao rt.Cells(rt.Rows.Count-1,3).Text = dr1("szh") rt.Cells(rt.Rows.Count-1,4).Text = dr1("szmc") rt.Cells(rt.Rows.Count-1,7).Text = dr1("kslx") rt.Cells(rt.Rows.Count-1,12).Text =dr1("ks") xuhao += 1 End If End If Next ......
|
||||
-- 作者:大雪山 -- 发布时间:2016/10/29 20:15:00 -- 老师能帮我再修改下就实现目标了.
此主题相关图片如下:现在显示.png 此主题相关图片如下:目标实现.png [此贴子已经被作者于2016/10/29 20:17:29编辑过]
|
||||
-- 作者:大雪山 -- 发布时间:2016/10/30 10:54:00 -- 怎么将现在的序号全部1,改成序号12345678?
|
||||
-- 作者:狐狸爸爸 -- 发布时间:2016/10/30 12:46:00 -- rt.Cells(rt.Rows.Count-1,2).Text = xuhao xuhao = xuhao+1
|
||||
-- 作者:大雪山 -- 发布时间:2016/10/31 21:52:00 -- 有色部分是分栏打印部分,整合成左单右双,分两栏的模式,如图
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编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2016/10/31 22:18:00 -- 上实例 |
||||
-- 作者:大雪山 -- 发布时间:2016/11/1 9:45:00 -- 序号分单双号,课程分二栏的成绩单按钮如何修改?
此主题相关图片如下:snap3.bmp 此主题相关图片如下:snap4.bmp |
||||
-- 作者:有点青 -- 发布时间:2016/11/1 10:15:00 -- 简单改了一下,细节自己调整。
|
||||
-- 作者:大雪山 -- 发布时间:2016/11/1 12:07:00 -- 老师已经实现要求,如果将9楼文件,课程替换成班级名单,再能解决就非常满意了。我想了几天就是不知如何换成专业班级名单。
[此贴子已经被作者于2016/11/1 12:08:06编辑过]
|