Foxtable(狐表)用户栏目专家坐堂 → 对专业报表的1点建议


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

主题:对专业报表的1点建议

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


加好友 发短信
等级:一尾狐 帖子:445 积分:3013 威望:0 精华:0 注册:2008/9/13 10:49:00
对专业报表的1点建议  发帖心情 Post By:2008/11/30 3:39:00 [只看该作者]

专业报表功能很强。但呆在论坛很久了,但基本没什么人提及,是不是没有人用。少人用的原因是否因它:不是图形化。)不知道老六为什么不改进。

改进好了(图形化),可能对很多人有好处,我学专业报表到这个时候,我的实际情况更喜欢这样子写,因为习惯了.但希望foxtable 更好更高地发展。(国内有这样的数据管理软件不容易,因此以前强烈建议支持oracle等等数据库)

我试用过了一、二次水晶报表,可以用图形(但可以转为语言) ,也可以用语言写(这点不知foxtable能否参考1下)。(只是水晶报表的帮助给我的感觉就是做很差,很多东西没有条理1样,反证我是看着帮助,基本学不下去)
[此贴子已经被作者于2008-11-30 4:02:50编辑过]

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


加好友 发短信
等级:一尾狐 帖子:445 积分:3013 威望:0 精华:0 注册:2008/9/13 10:49:00
  发帖心情 Post By:2008/11/30 3:43:00 [只看该作者]

以下是我这段时间用专业报表写的1个报表,因为做完了,算是来发下唠叨:(我猜基本少人会花这么多的时间来做这样的事情,但我要的功能可能暂时只有专业报表才能实现。不得不学)
[此贴子已经被作者于2008-11-30 4:03:15编辑过]

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


加好友 发短信
等级:一尾狐 帖子:445 积分:3013 威望:0 精华:0 注册:2008/9/13 10:49:00
  发帖心情 Post By:2008/11/30 3:43:00 [只看该作者]


Dim dst As WinForm.DataList = Forms("窗口").Controls("DataList1")
For Index As Integer = 0 To dst.Count - 1
    If dst.GetChecked(Index) Then
        Dim dr As DataRow = dst.GetDataRow(Index)
            dr("记录") = true    '将 记录 列设为true        
               if  dr("记录") = true then '作标记,打印之后,下次不再打印
                  

'********报表************
Dim doc As New Printdoc
    'Doc.PageSetting.LeftMargin = 20 '设置左边距
    'Doc.PageSetting.RightMargin = 17 '设置右边距
    Doc.Columns.Add() '增加第一栏
    Doc.Columns.Add() '增加第二栏
    Doc.Columns(0).Spacing = 0 '栏间距0毫米
Dim rt2 As New prt.RenderTable() '定义一个表格对象
    rt2.Style.GridLines.All = prt.Linedef.Default '网格线为默认类型
    rt2.Cols.Count = 2 '设置总列数
    rt2.Cells(0,0).SpanCols = 2 '第1行第1列向右合并2列
    rt2.Cells(1,0).SpanCols = 2 '第2行第1列向右合并2列
    rt2.Cells(2,0).SpanCols = 2 '第3行第1列向右合并2列
    rt2.Cells(3,0).SpanCols = 2 '第4行第1列向右合并2列
    rt2.Cells(9,0).SpanCols = 2 '第10行第1列向右合并2列
    rt2.Cells(10,0).SpanCols = 2 '第11行第1列向右合并2列
    rt2.Cells(11,0).SpanCols = 2 '第12行第1列向右合并2列
    rt2.Cells(12,0).SpanCols = 2 '第13行第1列向右合并2列
    rt2.Cells(13,0).SpanCols = 2 '第14行第1列向右合并2列
    rt2.Rows(0).Style.TextAlignHorz = prt.AlignHorzEnum.Center '设置第一行居中
    rt2.Rows(1).Style.TextAlignHorz = prt.AlignHorzEnum.Center '设置第二行居中
    rt2.Cells(0,0).Style.FontSize = 30  '设置第一行字体
    rt2.Cells(1,0).Style.FontSize = 15  '设置第二行字体
    rt2.CellStyle.Spacing.All = 1  '行与行之间的间隔
    rt2.Cells(0,0).text = "单位"
    rt2.Cells(1,0).text = "记录"
    rt2.Cells(2,0).text = "管理编号: "
    rt2.Cells(3,0).Text = "编号: " & Tables("表A").rows(Index)("编号")
    rt2.Cells(4,0).Text = "名称: " & Tables("表A").rows(Index)("名称")
    rt2.Cells(4,1).Text = "数量: " & Tables("表A").rows(Index)("数量")
    rt2.Cells(5,0).Text = "项目: " & "----"
    rt2.Cells(5,1).Text = "依据: " & "------"
    rt2.Cells(6,0).Text = "-: " & "------"
    rt2.Cells(6,1).Text = "方法: " & "------"
    doc.pageheader = rt2 '加入到页眉中


'关联表报表内容
Dim rt As  prt.RenderTable
rt = New prt.RenderTable
rt.Style.GridLines.All = prt.Linedef.Default '网格线为默认类型
rt.CellStyle.Spacing.All = 1  '行与行之间的间隔
rt.RowGroups(0,1).Header = prt.TableHeaderEnum.all '将第一行作为表头.
Dim bctbl As dataTable = dataTables("表C")
dim bcrows as list(of datarow)
bcrows = bctbl.select("[编号] = '" & dr("编号") & "'")
'dim bchs as integer = bcrows.count
if bcrows.count < 58 then
    for bci as integer = 0 to bcrows.count -1
            rt.Cells(0,0).Text = "地点"
            rt.Cells(0,1).Text = "编号" 
            rt.Cells(0,2).Text = "名称"
            rt.Cells(0,3).Text = "-"
            rt.Cells(bci+1,0).Text = bcrows(bci)("地点")
            rt.Cells(bci+1,1).Text = bcrows(bci)("编号")
            rt.Cells(bci+1,2).Text = bcrows(bci)("名称")
            rt.Cells(bci+1,3).Text = bcrows(bci)("-")
         for jia as integer = bci+1 to 58
             rt.Cells(jia,3).Text = " "
         next
    next
else
      for bci as integer = 0 to bcrows.count -1
            rt.Cells(0,0).Text = "地点"
            rt.Cells(0,1).Text = "编号" 
            rt.Cells(0,2).Text = "名称"
            rt.Cells(0,3).Text = "-"
            rt.Cells(bci+1,0).Text = bcrows(bci)("地点")
            rt.Cells(bci+1,1).Text = bcrows(bci)("编号")
            rt.Cells(bci+1,2).Text = bcrows(bci)("名称")
            rt.Cells(bci+1,3).Text = bcrows(bci)("-")
         for jia2 as integer = bci+1 to 116
             rt.Cells(jia2,3).Text = " "
         next
       next

end if
    

doc.Body.Children.Add(rt)

'****设置页脚****
Dim rxx As New prt.RenderTable()
    'rxx.Style.GridLines.All = prt.Linedef.Default     '是否需要网格
    rxx.Cols.Count = 2 '设置总列数
    rxx.rows(1).Style.Borders.Bottom = New prt.LineDef
    rxx.Cells(0,0).text ="-:"
    rxx.Cells(0,1).text ="-:"
    rxx.Cells(0,2).text ="-:"
    rxx.Cells(0,3).text = "日期:"
    rxx.Cells(0,4).text = "-:"   
doc.PageFooter = rxx
doc.Preview


               end if
    end if
next



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


加好友 发短信
等级:一尾狐 帖子:445 积分:3013 威望:0 精华:0 注册:2008/9/13 10:49:00
  发帖心情 Post By:2008/11/30 3:53:00 [只看该作者]

专业报表功能强,就是烦琐(我的意思是改进这点吧) 因在论坛看过大家的,基本写多几行代码都说是烦了,如果要写这么多,,,不知是什么说法了.
[此贴子已经被作者于2008-11-30 3:53:59编辑过]

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


加好友 发短信
等级:管理员 帖子:47448 积分:251054 威望:0 精华:91 注册:2008/6/17 17:14:00
  发帖心情 Post By:2008/11/30 9:29:00 [只看该作者]

呵呵,专业报表最难,因为它最繁琐。

专业报表也最简单,因为它没有复杂的逻辑,只是搭积木而已。

代码虽然长,但是大多数是重复的,复制粘贴,改改列名、表名、位置即可。

正式版本发布后,在可以预期的时间内,会给专业报表提供自动编码功能。
[此贴子已经被作者于2008-11-30 9:29:42编辑过]

 回到顶部