Foxtable(狐表)用户栏目专家坐堂 → 请问怎么改呀代码


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

主题:请问怎么改呀代码

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


加好友 发短信
等级:小狐 帖子:311 积分:2288 威望:0 精华:0 注册:2011/9/22 10:21:00
请问怎么改呀代码  发帖心情 Post By:2012/9/5 10:29:00 [显示全部帖子]

 
图片点击可在新窗口打开查看此主题相关图片如下:4.jpg
图片点击可在新窗口打开查看
 

 

Dim dt As DataTable
Dim g As New GroupTableBuilder("统计表1", DataTables("fenfa"))
g.Groups.AddDef("faby","投递员")
g.Groups.AddDef("baom","报刊名称")
g.Totals.AddDef("fens","份数")
g.Filter = "[zzrq] >= '1/1/2012 ' And [zzrq] <= '12/31/2012 ' And [pian] = '城西 '"
g.FromServer = True
dt = g.Build(True)
Dim doc As New PrintDoc
Dim rt As New prt.RenderTable
Dim Count As Integer = 0
For Each Col As DataCol In Dt.DataCols
    rt.Cells(0,Count).Text = Col.Name
    For r As Integer = 0 To dt.DataRows.Count - 1
        rt.Cells(r +1,Count).Text = dt.DataRows(r)(Col.Name)
    Next
    Count = Count + 1
Next
rt.Style.Gridlines.All = New prt.Linedef(Color.Gray)
rt.CellStyle.Spacing.All = 1
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center
rt.Style.Font = New Font("宋体", 20, FontStyle.Bold) '设置字体
rt.Style.GridLines.All = New prt.LineDef '将网格线类型设为默认类型
rt.Height = 710 '设置表格的高度为120毫米
rt.Cells(1,0).SpanRows = 2
rt.Cells(3,0).SpanRows = 2
rt.Cells(5,0).SpanRows = 2
rt.Cells(7,0).SpanRows = 2
rt.Cells(9,0).SpanRows = 2
rt.Cells(11,0).SpanRows = 2
rt.Cells(13,0).SpanRows = 2
rt.Cells(15,0).SpanRows = 2
rt.Cells(17,0).SpanRows = 2
rt.Cells(19,0).SpanRows = 2
rt.Cells(21,0).SpanRows = 2
rt.Cells(23,0).SpanRows = 2
rt.Cells(25,0).SpanRows = 2
rt.Cells(27,0).SpanRows = 2
rt.Cells(29,0).SpanRows = 2
rt.Cells(31,0).SpanRows = 2
rt.Cells(33,0).SpanRows = 2
rt.Cells(35,0).SpanRows = 2
rt.Cells(37,0).SpanRows = 2
rt.Cells(39,0).SpanRows = 2
rt.Cells(41,0).SpanRows = 2
rt.Cells(43,0).SpanRows = 2
rt.Cells(45,0).SpanRows = 2
rt.Cells(47,0).SpanRows = 2
rt.Cells(49,0).SpanRows = 2
rt.Cells(51,0).SpanRows = 2
rt.Cells(53,0).SpanRows = 2
rt.Cells(55,0).SpanRows = 2
rt.Cells(57,0).SpanRows = 2
rt.Cells(59,0).SpanRows = 2
rt.Cells(61,0).SpanRows = 2
rt.Cells(63,0).SpanRows = 2
rt.Cells(65,0).SpanRows = 2
rt.Cells(67,0).SpanRows = 2
rt.Cells(69,0).SpanRows = 2
rt.Cells(71,0).SpanRows = 2
rt.Style.TextAlignHorz = prt.AlignHorzEnum.Center '水平居中
rt.Style.TextAlignVert = prt.AlignVertEnum.Center '垂直居中
rt.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '第一行内容水平居中
rt.Rows(0).Style.TextAlignVert = prt.AlignVertEnum.Center '第一行内容垂直居中
rt.Rows(0).Style.BackColor = Color.LightGray '第一行背景颜色设为灰色.
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.All '将第一行作为表头.
doc.Body.Children.Add(rt)
doc.Preview()

原代码如上。

 但是打印出来太多页数了,我想变成如下效果的统计,请问高手,如何写代码呀

 

  投递员    日报   晚报      
   曹晓玲    233    447    

 回到顶部