Foxtable(狐表)用户栏目专家坐堂 → [求助]报表打印中公式问题


  共有4623人关注过本帖树形打印复制链接

主题:[求助]报表打印中公式问题

帅哥哟,离线,有人找我吗?
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107727 积分:547968 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By: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

......

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107727 积分:547968 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/31 22:18:00 [显示全部帖子]

上实例

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107727 积分:547968 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/11/1 14:20:00 [显示全部帖子]

方法一样的啊,什么取得课程的内容就一样怎么取班级名单的内容,取得到内容了想填充打印什么都可以

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107727 积分:547968 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/11/4 9:27:00 [显示全部帖子]

1、把日期加到页脚中
.PageFooter = Date.today & " 第[PageNo]页,共[PageCount]页"  '页脚

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107727 积分:547968 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/11/4 13:37:00 [显示全部帖子]

专业报表打印页眉页脚参考:http://www.foxtable.com/webhelp/scr/1197.htm

表格打印和专业报表打印是2回事

 回到顶部