标题:请教各位高手:下面是用代码写与的报表文件.frx,里面的一些属性是什么意思, ...
取消只看楼主
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1519
专家分:174
注 册:2006-6-3
结帖率:79.3%
已结贴  问题点数:20 回复次数:5 
请教各位高手:下面是用代码写与的报表文件.frx,里面的一些属性是什么意思,请不吝指教
WAIT WINDOW NOWAIT '正在生成报表,请稍候...'
 IF  .NOT. USED('tblClass_1')
    USE IN 0 tblClass_1 ALIAS TBLCLASS_1
 ENDIF
 SELECT TBLCLASS_1
 SET ORDER TO 班名称
 LOREPORT = NEWOBJECT('SFReportFile','SFREPOBJ')
 LOREPORT.CREPORTFILE = 'MyReport.frx'
 LOREPORT.LSUMMARYBAND = .T.
 LOREPORT.CFONTNAME = '宋体'
 LOREPORT.NFONTSIZE = 11
 LOREPORT.LPRIVATEDATASESSION = .F.
 LOREPORT.CUNITS = 'C'
 LOVARIABLE = LOREPORT.CREATEVARIABLE()
  = 'nCountStudent'
 LOVARIABLE.CVALUE = 0
 LOVARIABLE.CINITIALVALUE = 0
 LOVARIABLE.CTOTALTYPE = 'Count'
 LOVARIABLE.NRESETONGROUP = 1
 LOVARIABLE = LOREPORT.CREATEVARIABLE()
  = 'nAveMark1'
 LOVARIABLE.CVALUE = 'tblclass_1.语文成绩'
 LOVARIABLE.CINITIALVALUE = 0
 LOVARIABLE.CTOTALTYPE = 'Average'
 LOVARIABLE.NRESETONGROUP = 1
 LOVARIABLE = LOREPORT.CREATEVARIABLE()
  = 'nAveMark2'
 LOVARIABLE.CVALUE = 'tblclass_1.数学成绩'
 LOVARIABLE.CINITIALVALUE = 0
 LOVARIABLE.CTOTALTYPE = 'Average'
 LOVARIABLE.NRESETONGROUP = 1
 LOPAGEHEADER = LOREPORT.GETREPORTBAND('Page Header')
 LOPAGEHEADER.NHEIGHT = 4
 LOOBJECT = LOPAGEHEADER.ADDITEM('text')
 LOOBJECT.CEXPRESSION = '学生成绩表'
 LOOBJECT.CFONTNAME = '楷体_GB2312'
 LOOBJECT.NFONTSIZE = 20
 LOOBJECT.NWIDTH = 20
 LOOBJECT.NHEIGHT = 2
 LOOBJECT.NVPOSITION = 2
 LOOBJECT.NHPOSITION = 20
 LOOBJECT.NFORECOLOR = RGB(0,0,0)
  LOREPORT.CREATEGROUPBAND()
 LOGROUP = LOREPORT.GETREPORTBAND('Group Header',1)
 LOGROUP.CEXPRESSION = 'tblClass_1.班名称'
 LOGROUP.NHEIGHT = 2.6
 LOGROUP.LPRINTONEACHPAGE = .T.
 LOGROUP.LSTARTONNEWPAGE = .T.
 LOOBJECT = LOGROUP.ADDITEM('field')
 LOOBJECT.CEXPRESSION = "'班级名称:'+ALLTRIM(班名称)"
 LOOBJECT.NWIDTH = 40
 LOOBJECT.NHEIGHT = 1
 LOOBJECT.NVPOSITION = 0.5
 LOOBJECT.NHPOSITION = 2
 LOOBJECT = LOGROUP.ADDITEM('box')
 LOOBJECT.NHEIGHT = 1.5
 LOOBJECT.NWIDTH = 64
 LOOBJECT.NVPOSITION = 2
 LOOBJECT.NHPOSITION = 2
 LOOBJECT.NPENSIZE = 1
 LOOBJECT = LOGROUP.ADDITEM('line')
 LOOBJECT.NHEIGHT = 1.5
 LOOBJECT.NVPOSITION = 2
 LOOBJECT.NHPOSITION = 18
 LOOBJECT.LVERTICAL = .T.
 LOOBJECT.NPENSIZE = 1
 LOOBJECT = LOGROUP.ADDITEM('line')
 LOOBJECT.NHEIGHT = 1.5
 LOOBJECT.NVPOSITION = 2
 LOOBJECT.NHPOSITION = 42
 LOOBJECT.LVERTICAL = .T.
 LOOBJECT.NPENSIZE = 1
 LOOBJECT = LOGROUP.ADDITEM('text')
 LOOBJECT.CEXPRESSION = '学生姓名'
 LOOBJECT.NWIDTH = 8
 LOOBJECT.NVPOSITION = 2.5
 LOOBJECT.NHPOSITION = 6
 LOOBJECT = LOGROUP.ADDITEM('text')
 LOOBJECT.CEXPRESSION = '语文成绩'
 LOOBJECT.NWIDTH = 8
 LOOBJECT.NVPOSITION = 2.5
 LOOBJECT.NHPOSITION = 28
 LOOBJECT = LOGROUP.ADDITEM('text')
 LOOBJECT.CEXPRESSION = '数学成绩'
 LOOBJECT.NWIDTH = 8
 LOOBJECT.NVPOSITION = 2.5
 LOOBJECT.NHPOSITION = 50
 LODETAIL = LOREPORT.GETREPORTBAND('Detail')
 LODETAIL.NHEIGHT = 1.5
 LOOBJECT = LODETAIL.ADDITEM('box')
 LOOBJECT.NHEIGHT = 1.5
 LOOBJECT.NWIDTH = 64
 LOOBJECT.NVPOSITION = 0
 LOOBJECT.NHPOSITION = 2
 LOOBJECT.NPENSIZE = 1
 LOOBJECT = LODETAIL.ADDITEM('line')
 LOOBJECT.NHEIGHT = 1.5
 LOOBJECT.NVPOSITION = 0
 LOOBJECT.NHPOSITION = 18
 LOOBJECT.LVERTICAL = .T.
 LOOBJECT.NPENSIZE = 1
 LOOBJECT = LODETAIL.ADDITEM('line')
 LOOBJECT.NHEIGHT = 1.5
 LOOBJECT.NVPOSITION = 0
 LOOBJECT.NHPOSITION = 42
 LOOBJECT.LVERTICAL = .T.
 LOOBJECT.NPENSIZE = 1
 LOOBJECT = LODETAIL.ADDITEM('field')
 LOOBJECT.CEXPRESSION = 'tblClass_1.学生姓名'
 LOOBJECT.NWIDTH = 10
 LOOBJECT.NVPOSITION = 0.25
 LOOBJECT.NHPOSITION = 6
 LOOBJECT = LODETAIL.ADDITEM('field')
 LOOBJECT.CEXPRESSION = 'tblClass_1.语文成绩'
 LOOBJECT.NWIDTH = 12
 LOOBJECT.NVPOSITION = 0.25
 LOOBJECT.NHPOSITION = 26
 LOOBJECT = LODETAIL.ADDITEM('field')
 LOOBJECT.CEXPRESSION = 'tblClass_1.数学成绩'
 LOOBJECT.NWIDTH = 12
 LOOBJECT.NVPOSITION = 0.25
 LOOBJECT.NHPOSITION = 48
 LOGROUP = LOREPORT.GETREPORTBAND('Group Footer',1)
 LOGROUP.NHEIGHT = 2
 LOGROUP.LPRINTONEACHPAGE = .T.
 LOGROUP.LSTARTONNEWPAGE = .T.
 LOOBJECT = LOGROUP.ADDITEM('field')
 LOOBJECT.CEXPRESSION = "'班级人数:'+STR(nCountStudent)"
 LOOBJECT.NWIDTH = 20
 LOOBJECT.NHEIGHT = 1
 LOOBJECT.NVPOSITION = 1
 LOOBJECT.NHPOSITION = 2
 LOOBJECT = LOGROUP.ADDITEM('field')
 LOOBJECT.CEXPRESSION = "'语文平均成绩:'+STR(nAveMark1)"
 LOOBJECT.NWIDTH = 25
 LOOBJECT.NHEIGHT = 1
 LOOBJECT.NVPOSITION = 1
 LOOBJECT.NHPOSITION = 22
 LOOBJECT = LOGROUP.ADDITEM('field')
 LOOBJECT.CEXPRESSION = "'数学平均成绩:'+STR(nAveMark2)"
 LOOBJECT.NWIDTH = 25
 LOOBJECT.NHEIGHT = 1
 LOOBJECT.NVPOSITION = 1
 LOOBJECT.NHPOSITION = 44
 LOPAGEFOOTER = LOREPORT.GETREPORTBAND('Page Footer')
 LOPAGEFOOTER.NHEIGHT = 4
 LOOBJECT = LOPAGEFOOTER.ADDITEM('field')
 LOOBJECT.CEXPRESSION = "'共'+STR(_PAGETOTAL)+'页    第'+STR(_PAGENO)+'页'"
 LOOBJECT.NWIDTH = 30
 LOOBJECT.NHEIGHT = 1
 LOOBJECT.NVPOSITION = 1
 LOOBJECT.NHPOSITION = 40
  LOREPORT.SAVE()
 REPORT FORM MyReport.frx PREVIEW
*


[ 本帖最后由 sylknb 于 2012-12-29 17:31 编辑 ]
搜索更多相关主题的帖子: always 
2012-12-29 17:29
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1519
专家分:174
注 册:2006-6-3
得分:0 
sdta:你提供的内容与上面的题目中的内容对不起来
2012-12-29 20:25
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1519
专家分:174
注 册:2006-6-3
得分:0 
谢谢各位,我从以下的内容中得到了一些理介。现提供给大家,不知有否对大家的帮助。
 http://bbs.在这篇文章中讲的还比较细。
又附上中vfp9.0权威指南的一文,可都是英文,看不很明白。
repobj.rar (15.48 KB)
哪一位高手能否把它译成中文?
2012-12-30 11:47
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1519
专家分:174
注 册:2006-6-3
得分:0 
请教2个:

1、这里有一句不知何意思:NRESETONGROUP = 1,对应报表设计器中何内容?我找不到,其它基本与设计器对应起来。从本句从字面上理介好象重新分组,值为1表示何义。
现取一段,与设计器中对照
 LOVARIABLE = LOREPORT.CREATEVARIABLE() &&建立变量
  = 'nCountStudent'&&变量名
 LOVARIABLE.CVALUE = 0  &&要储存的值
 LOVARIABLE.CINITIALVALUE = 0&&初始值
 LOVARIABLE.CTOTALTYPE = 'Count'&&计算类型(计数)
LOVARIABLE.NRESETONGROUP = 1  &&&表示何义
对应设计器应是重置。用程序生成的报表,在报表设计器中以分组形式重置。
2、我找开frx结构文件,并游览各字段。
objtype=18,&&表示变量
name=nCountStudent  &&变量名
totaltype=1  &&计算类型1计数
resettotall =7  &&表示在数据分组2重置计算。(6为数据分组1重置计算)但报表中没有数据分组2,只有一个分组.报表结构文件中的值与实际报表为何又不同?
2013-01-01 12:14
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1519
专家分:174
注 册:2006-6-3
得分:0 
我附上所有的原件
repobj.rar (23.4 KB)
,请各位行家指教。
2013-01-02 10:20
sylknb
Rank: 4
等 级:贵宾
威 望:14
帖 子:1519
专家分:174
注 册:2006-6-3
得分:0 
我再重新上传一个,应该没有忘了
repobj.rar (59 KB)
2013-01-02 20:16



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-394453-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.160240 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved