如何判断分组在哪一页?

flythinking 2003-06-20 07:21:36
如何判断分组开始于哪一页?
有做过根据行数来分页,每页中里面又有分组的打印应该会遇到这个问题?即每页中的分组中的小计应该占用行,那所占用的行如何计算出来?
我计算出来后有一个问题是:每页中的分组由于行数限定会出现在不同页中,这时用cumulativeSum( if ( (列名[0] = 列名 [-1] , 0, 1 ) for all ) 得到的分组的行号会重复,比如前页的组号为8,而这一组在前页又没有显示完,在下一页继续显示,这时的组号将还是8,这样用(数据行数(用getrow()得到)+分组数)就少了行,如何判断分组在开始于哪一页,或有其它的什么方法?
不知我说明白了没有??
...全文
110 17 打赏 收藏 转发到动态 举报
写回复
用AI写文章
17 条回复
切换为时间正序
请发表友善的回复…
发表回复
flythinking 2003-06-26
  • 打赏
  • 举报
回复
谢了!!!
tulip2108 2003-06-25
  • 打赏
  • 举报
回复
可能是没法弄了,感觉象死循环。
http://www.cellsoft.cc/china/index.html
用友华表,免费替它做广告了,哈哈
我用的是还是老版本的3.35
还有的朋友用Formulaone
用数据窗口做打印很辛苦,特别是中国式的报表,而且做不好。


flythinking 2003-06-25
  • 打赏
  • 举报
回复
真的很感谢tuliplangel(酷儿)的热心帮助,能一直跟踪下来,如果多一些这样的人,就真是新手们的福音了。

你说的compute_add (getrow() - first(getrow() for group 2)/20 //追回行
我试了一下,才是不行。
后来想了一下,这个问题好像是没法解决了,因为cumulativeSum( if ( (pfxs_disc_rate [0] = pfxs_disc_rate [-1] and colortype [0] = colortype [-1]) or isnull( colortype ), 0, 1 ) for all)它是不管你的分组是再哪一页的,恰好这里的分页又用到了此值。

不过真的很感谢你!

另外,cell我是从来用过,能推荐一些介绍它的网站吗?
tulip2108 2003-06-25
  • 打赏
  • 举报
回复
想了想看看下面可不可以
是20行分一页的
加一下compute 字段
compute_add (getrow() - first(getrow() for group 2)/20 //追回行
grouprow改为
cumulativeSum( if ( (pfxs_disc_rate [0] = pfxs_disc_rate [-1] and colortype [0] = colortype [-1]) or isnull( colortype ), 0, 1 ) for all )+cumulativeSum(compute_add)


打印可以用cell或excell
flythinking 2003-06-24
  • 打赏
  • 举报
回复
(不好意思,昨天没发完)
接上:
column(band=trailer.1 id=14 alignment="1" tabsequence=32766 border="0" color="33554432" x="1696" y="104" height="60" width="142" format="[general]" html.valueishtml="0" name=spda_flh visible="0" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
line(band=trailer.1 x1="5" y1="16" x2="1925" y2="16" name=l_3 visible="1" pen.style="0" pen.width="9" pen.color="0" background.mode="2" background.color="16777215" )
text(band=trailer.1 alignment="1" text="操作员:" border="0" color="33554432" x="46" y="168" height="60" width="224" html.valueishtml="0" name=t_5 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=trailer.1 alignment="0" expression="first( pfxs_czy for group 1 )"border="4" color="33554432" x="283" y="168" height="60" width="370" format="[GENERAL]" html.valueishtml="0" name=compute_8 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.1 alignment="1" text="经办人:" border="0" color="33554432" x="1298" y="168" height="60" width="219" html.valueishtml="0" name=pfxs_by_person_t visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.1 alignment="1" text="" border="4" color="33554432" x="1531" y="168" height="60" width="361" html.valueishtml="0" name=t_15 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.1 alignment="1" text="本页金额:" border="0" color="0" x="23" y="52" height="60" width="256" html.valueishtml="0" name=t_14 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
compute(band=trailer.1 alignment="0" expression="sum( compute_sum for group 1 )"border="4" color="33554432" x="293" y="52" height="60" width="357" format="#,###.00" html.valueishtml="0" name=compute_7 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.1 alignment="1" text="本页应收:" border="0" color="0" x="1253" y="52" height="60" width="265" html.valueishtml="0" name=t_13 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
compute(band=trailer.1 alignment="0" expression="round(sum( pfxs_real_lsj * pfxs_sl * pfxs_disc_rate for group 1),0)"border="4" color="33554432" x="1531" y="52" height="60" width="361" format="#,###.00" html.valueishtml="0" name=compute_9 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=trailer.1 alignment="0" expression="first( pfxs_disc_rate for all )"border="4" color="33554432" x="942" y="52" height="60" width="242" format="[GENERAL]" html.valueishtml="0" name=compute_discount visible="0" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.1 alignment="1" text="扣率:" border="0" color="33554432" x="731" y="52" height="60" width="201" html.valueishtml="0" name=t_11 visible="0" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.1 alignment="1" text="付款方式:" border="0" color="33554432" x="677" y="168" height="60" width="261" html.valueishtml="0" name=pfxs_pay_mode_t visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=trailer.1 alignment="0" expression="first( t_pay_mode_paymode_name for group 1 )"border="4" color="33554432" x="946" y="168" height="60" width="325" format="[GENERAL]" html.valueishtml="0" name=compute_10 visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
htmltable(border="1" )
htmlgen(clientevents="1" clientvalidation="1" clientcomputedfields="1" clientformatting="0" clientscriptable="0" generatejavascript="1" netscapelayers="0" )

完。请帮看看!!谢谢tuliplangel(酷儿)!!!

请问一下:compute_3是什么?

if(first(getrow() for group 2)=first(getrow() for page),0,1)
估计不行,因为for page(分页)就是通过grouprow/20计算出来的

打印可以用控件,用什么控件好?
tulip2108 2003-06-23
  • 打赏
  • 举报
回复
不知这样行不行,你试试吧。我这里没数据没法试
在分组2 Tailer增加一个compute字段
compute_add if(first(getrow() for group 2)=first(getrow() for page),0,1)

grouprow改为
cumulativeSum( if ( (pfxs_disc_rate [0] = pfxs_disc_rate [-1] and colortype [0] = colortype [-1]) or isnull( colortype ), 0, 1 ) for all )+cumulativeSum( compute_3 )+ cumulativeSum(compute_add)

觉得好象不一定行,如果为了打印可以用控件,数据窗口好麻烦。
flythinking 2003-06-23
  • 打赏
  • 举报
回复
接上:
column(band=detail id=5 alignment="1" tabsequence=32766 border="0" color="33554432" x="1330" y="16" height="60" width="219" format="#,##0.00" html.valueishtml="0" name=pfxs_real_lsj visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=detail alignment="1" expression=" pfxs_real_lsj * pfxs_sl "border="0" color="33554432" x="1541" y="16" height="60" width="361" format="#,##0.00" html.valueishtml="0" name=compute_sum visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=detail alignment="0" expression="if (getrow() = first(getrow() for group 2),1,0)"border="0" color="33554432" x="1961" y="16" height="60" width="46" format="[GENERAL]" html.valueishtml="0" name=compute_grouprow visible="0" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=detail alignment="0" expression="ceiling( compute_row /20)"border="0" color="33554432" x="1902" y="16" height="60" width="46" format="[GENERAL]" html.valueishtml="0" name=pagination visible="0" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
line(band=trailer.2 x1="27" y1="4" x2="1897" y2="4" name=l_4 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " pen.style="2" pen.width="5" pen.color="0" background.mode="2" background.color="16777215" )
line(band=trailer.2 x1="27" y1="84" x2="1897" y2="84" name=l_5 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " pen.style="2" pen.width="5" pen.color="0" background.mode="2" background.color="16777215" )
text(band=trailer.2 alignment="1" text="大类名:" border="0" color="0" x="50" y="16" height="60" width="192" html.valueishtml="0" name=t_18 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
compute(band=trailer.2 alignment="0" expression=" spda_flh + if ( pos(spda_color,'白') > 0,if (pos(upper(spda_color),'AB')>0,'其它','白色'),'其它')"border="0" color="0" x="256" y="16" height="60" width="192" format="[General]" html.valueishtml="0" name=sort visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=trailer.2 alignment="1" text="扣率:" border="0" color="0" x="503" y="16" height="60" width="155" html.valueishtml="0" name=t_19 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
compute(band=trailer.2 alignment="0" expression="first( pfxs_disc_rate for group 2 )"border="0" color="33554432" x="667" y="16" height="60" width="215" format="[GENERAL]" html.valueishtml="0" name=compute_12 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.2 alignment="1" text="金额:" border="0" color="0" x="928" y="16" height="60" width="169" html.valueishtml="0" name=t_17 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
compute(band=trailer.2 alignment="0" expression="sum( compute_sum for group 2 )"border="0" color="33554432" x="1106" y="16" height="60" width="288" format="#,###.00" html.valueishtml="0" name=compute_13 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=trailer.2 alignment="1" text="应收:" border="0" color="0" x="1399" y="16" height="60" width="160" html.valueishtml="0" name=t_16 visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
compute(band=trailer.2 alignment="0" expression="sum( compute_sum for group 2 ) * first( pfxs_disc_rate for group 2 )"border="0" color="33554432" x="1568" y="16" height="60" width="315" format="#,###.00" html.valueishtml="0" name=compute_subsum visible="1~tif (isnull(spda_flh) or spda_flh ='Z' ,0,1) " font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=trailer.2 alignment="0" expression="cumulativeSum( if ( (pfxs_disc_rate [0] = pfxs_disc_rate [-1] and colortype [0] = colortype [-1]) or isnull( colortype ), 0, 1 ) for all )
"border="0" color="33554432" x="1897" y="20" height="60" width="46" format="[GENERAL]" html.valueishtml="0" name=grouprow visible="0" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=trailer.2 alignment="0" expression="getrow() + grouprow"border="0" color="33554432" x="1957" y="20" height="60" width="46" format="[GENERAL]" html.valueishtml="0" name=compute_row visible="0" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
flythinking 2003-06-23
  • 打赏
  • 举报
回复
接上:
text(band=header alignment="1" text="销售部门:" border="0" color="33554432" x="23" y="380" height="60" width="261" html.valueishtml="0" name=bmda_bmmc_t visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=header id=19 alignment="0" tabsequence=32766 border="4" color="33554432" x="297" y="372" height="72" width="558" format="[general]" html.valueishtml="0" name=pfxs_bmh visible="1" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="1" text="销售日期:" border="0" color="33554432" x="1157" y="376" height="60" width="274" html.valueishtml="0" name=pfxs_rq_t visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=header id=1 alignment="0" tabsequence=32766 border="4" color="33554432" x="1431" y="376" height="72" width="393" format="[shortdate]" html.valueishtml="0" name=pfxs_rq visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
line(band=header x1="9" y1="488" x2="1915" y2="488" name=l_1 visible="1" pen.style="0" pen.width="9" pen.color="0" background.mode="2" background.color="16777215" )
text(band=header alignment="2" text="序 号" border="0" color="33554432" x="9" y="516" height="60" width="165" html.valueishtml="0" name=t_2 visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="商 品 编 号" border="0" color="33554432" x="238" y="516" height="60" width="347" html.valueishtml="0" name=pfxs_spbh_t visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="颜 色" border="0" color="33554432" x="777" y="516" height="60" width="238" html.valueishtml="0" name=t_10 visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="数 量" border="0" color="33554432" x="1065" y="516" height="60" width="224" html.valueishtml="0" name=pfxs_sl_t visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="价 格" border="0" color="33554432" x="1339" y="516" height="60" width="224" html.valueishtml="0" name=pfxs_real_lsj_t visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text="金 额" border="0" color="33554432" x="1637" y="516" height="60" width="229" html.valueishtml="0" name=t_3 visible="1" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
line(band=header x1="27" y1="600" x2="1897" y2="600" name=l_2 visible="1" pen.style="0" pen.width="5" pen.color="0" background.mode="2" background.color="16777215" )
column(band=header id=20 alignment="0" tabsequence=32766 border="0" color="33554432" x="1778" y="224" height="60" width="247" format="[general]" html.valueishtml="0" name=colortype visible="0" edit.limit=0 edit.case=any edit.autoselect=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=detail alignment="2" expression="getrow()"border="0" color="33554432" x="14" y="16" height="60" width="142" format="[GENERAL]" html.valueishtml="0" name=compute_2 visible="1~tif (isnull( pfxs_spbh ) or pfxs_spbh ='' ,0,1)" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=detail id=3 alignment="0" tabsequence=32766 border="0" color="33554432" x="165" y="16" height="60" width="594" format="[general]" html.valueishtml="0" name=pfxs_spbh visible="1" edit.limit=18 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-8" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=detail alignment="2" expression="left(spda_color,pos(spda_color,' ')-1) "border="0" color="33554432" x="731" y="16" height="60" width="302" format="[GENERAL]" html.valueishtml="0" name=compute_5 visible="1" font.face="Arial" font.height="-8" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=detail id=4 alignment="1" tabsequence=32766 border="0" color="33554432" x="1006" y="16" height="60" width="233" format="0.00" html.valueishtml="0" name=pfxs_sl visible="1" edit.limit=0 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
compute(band=detail alignment="0" expression="if( left(upper(spda_jldw),1) >='A' and left(upper(spda_jldw),1) <='Z' ,left(upper(spda_jldw),1),spda_jldw)"border="0" color="33554432" x="1243" y="16" height="60" width="78" format="[GENERAL]" html.valueishtml="0" name=compute_6 visible="1" font.face="Arial" font.height="-8" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
flythinking 2003-06-23
  • 打赏
  • 举报
回复
release 8;
datawindow(units=0 timer_interval=0 color=1073741824 processing=0 HTMLDW=no print.documentname="" print.orientation = 0 print.margin.left = 110 print.margin.right = 110 print.margin.top = 96 print.margin.bottom = 96 print.paper.source = 0 print.paper.size = 0 print.prompt=no print.buttons=no print.preview.buttons=no )
header(height=604 color="536870912" )
summary(height=0 color="536870912" )
footer(height=4 color="536870912" )
detail(height=92 color="536870912" )
table(column=(type=datetime updatewhereclause=yes name=pfxs_rq dbname="pfxs.rq" )
column=(type=char(10) updatewhereclause=yes name=pfxs_pzh dbname="pfxs.pzh" )
column=(type=char(18) updatewhereclause=yes name=pfxs_spbh dbname="pfxs.spbh" )
column=(type=decimal(2) updatewhereclause=yes name=pfxs_sl dbname="pfxs.sl" )
column=(type=decimal(2) updatewhereclause=yes name=pfxs_real_lsj dbname="pfxs.real_lsj" )
column=(type=char(12) updatewhereclause=yes name=pfxs_by_person dbname="pfxs.by_person" )
column=(type=char(12) updatewhereclause=yes name=bmda_bmmc dbname="bmda.bmmc" )
column=(type=char(40) updatewhereclause=yes name=pfsda_pfsmc dbname="pfsda.pfsmc" )
column=(type=char(16) updatewhereclause=yes name=t_pay_mode_paymode_name dbname="t_pay_mode.paymode_name" )
column=(type=char(8) updatewhereclause=yes name=pfxs_czy dbname="pfxs.czy" )
column=(type=decimal(4) updatewhereclause=yes name=t_sale_syd_ssje dbname="t_sale_syd.ssje" )
column=(type=decimal(4) updatewhereclause=yes name=t_sale_syd_yfje dbname="t_sale_syd.yfje" )
column=(type=char(30) updatewhereclause=yes name=spda_spmc dbname="spda.spmc" )
column=(type=char(6) updatewhereclause=yes name=spda_flh dbname="spda.flh" )
column=(type=char(24) updatewhereclause=yes name=spda_color dbname="spda.color" )
column=(type=decimal(4) updatewhereclause=yes name=pfxs_disc_rate dbname="pfxs.disc_rate" )
column=(type=decimal(4) updatewhereclause=yes name=t_sale_syd_ysje dbname="t_sale_syd.ysje" )
column=(type=char(10) updatewhereclause=yes name=spda_jldw dbname="spda.jldw" )
column=(type=char(6) updatewhereclause=yes name=pfxs_bmh dbname="pfxs.bmh" )
column=(type=char(10) updatewhereclause=yes name=colortype dbname="colortype" )
retrieve="PBSELECT( VERSION(400) TABLE(NAME=~"pfxs~" ) TABLE(NAME=~"bmda~" ) TABLE(NAME=~"pfsda~" ) TABLE(NAME=~"t_pay_mode~" ) TABLE(NAME=~"t_sale_syd~" ) TABLE(NAME=~"spda~" ) COLUMN(NAME=~"pfxs.rq~") COLUMN(NAME=~"pfxs.pzh~") COLUMN(NAME=~"pfxs.spbh~") COLUMN(NAME=~"pfxs.sl~") COLUMN(NAME=~"pfxs.real_lsj~") COLUMN(NAME=~"pfxs.by_person~") COLUMN(NAME=~"bmda.bmmc~") COLUMN(NAME=~"pfsda.pfsmc~") COLUMN(NAME=~"t_pay_mode.paymode_name~") COLUMN(NAME=~"pfxs.czy~") COLUMN(NAME=~"t_sale_syd.ssje~") COLUMN(NAME=~"t_sale_syd.yfje~") COLUMN(NAME=~"spda.spmc~") COLUMN(NAME=~"spda.flh~") COLUMN(NAME=~"spda.color~") COLUMN(NAME=~"pfxs.disc_rate~") COLUMN(NAME=~"t_sale_syd.ysje~") COLUMN(NAME=~"spda.jldw~") COLUMN(NAME=~"pfxs.bmh~") COMPUTE(NAME=~"colortype = spda.flh + case when ( charindex('白',spda.color) > 0 and charindex('AB',upper(spda.color)) =0) then '白色' else '其它' end~") JOIN (LEFT=~"pfxs.bmh~" OP =~"=~"RIGHT=~"bmda.bmh~" ) JOIN (LEFT=~"bmda.bmh~" OP =~"=~"RIGHT=~"pfsda.bmh~" ) JOIN (LEFT=~"pfxs.pay_mode~" OP =~"=~"RIGHT=~"t_pay_mode.pay_mode~" ) JOIN (LEFT=~"pfsda.pfsbh~" OP =~"=~"RIGHT=~"t_sale_syd.pfsbh~" ) JOIN (LEFT=~"pfxs.pzh~" OP =~"=~"RIGHT=~"t_sale_syd.pzh~" ) JOIN (LEFT=~"pfxs.spbh~" OP =~"=~"RIGHT=~"spda.spbh~" )WHERE( EXP1 =~"pfxs.pzh~" OP =~"=~" EXP2 =~":pzh~" ) ) ARG(NAME = ~"pzh~" TYPE = string) " arguments=(("pzh", string)) sort="sort A pfxs_disc_rate A pfxs_spbh A " )
group(level=1 header.height=0 trailer.height=248 by=("pagination" ) newpage=yes header.color="536870912" trailer.color="536870912" )
group(level=2 header.height=0 trailer.height=92 by=("colortype" , "pfxs_disc_rate" ) header.color="536870912" trailer.color="536870912" )
bitmap(band=header filename=".\HEAD.BMP" x="9" y="4" height="204" width="2048" border="0" name=p_1 visible="0" )
compute(band=header alignment="2" expression="'第'+page()+'页'+' 共'+pageCount()+'页'"border="4" color="33554432" x="741" y="372" height="64" width="462" format="[General]" html.valueishtml="0" name=compute_1 visible="0" font.face="Arial" font.height="-9" font.weight="400" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="2" text=" 销 售 单" border="0" color="0" x="443" y="68" height="100" width="741" html.valueishtml="0" name=t_1 visible="1" font.face="Arial" font.height="-18" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="2" background.color="16777215" )
text(band=header alignment="1" text="客户名称:" border="0" color="33554432" x="32" y="272" height="60" width="251" html.valueishtml="0" name=pfsda_pfsmc_t visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=header id=8 alignment="0" tabsequence=32766 border="4" color="33554432" x="297" y="272" height="72" width="562" format="[general]" html.valueishtml="0" name=pfsda_pfsmc visible="1" edit.limit=40 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-12" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
text(band=header alignment="1" text="单据号:" border="0" color="33554432" x="1157" y="272" height="60" width="270" html.valueishtml="0" name=pfxs_pzh_t visible="1" font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
column(band=header id=2 alignment="0" tabsequence=32766 border="4" color="33554432" x="1426" y="272" height="72" width="402" format="[general]" html.valueishtml="0" name=pfxs_pzh visible="1" edit.limit=10 edit.case=any edit.focusrectangle=no edit.autoselect=yes edit.autohscroll=yes edit.imemode=0 font.face="Arial" font.height="-9" font.weight="700" font.family="2" font.pitch="2" font.charset="0" background.mode="1" background.color="536870912" )
tulip2108 2003-06-23
  • 打赏
  • 举报
回复
把数据窗口倒出来放上来看看。
flythinking 2003-06-23
  • 打赏
  • 举报
回复
感谢tuliplangel(酷儿)!!!
但是compute_2的值通过dw_1.Object.compute_2[1]读不出来,只有用describe("evaluate('sum( compute_grouprow for all )',1)"))读,也就是compute_2就无意义了。

to waterstony(王小石):

每页中的分组中的小计可能占用多行。

还有个小问题是:所属同一分组在不同的页中,用
cumulativeSum( if ( (列名[0] = 列名 [-1] , 0, 1 ) for all ) 得到的分组的行号不会加1,和前一页的分组号相同,而我想让它为6,这样计算总行数就不会少一行。我是用getrow() + cumulativeSum( if ( (列名[0] = 列名 [-1] , 0, 1 ) for all )得到行数,并以它进行分页的。
比如说当前页中最后一个分组号为5,但是当前页没有把这个组的数据全部显示完,再下一页会继续显示,但此时得到的分组号还是为5(我想让它为6),有什么办法可以解决?
tulip2108 2003-06-22
  • 打赏
  • 举报
回复
建两个计算域:
在detail中 compute_1 if(getrow() = first(getrow() for group 1) ,1 ,0)
在summary区 compute_2 sum(compute_1 for all)
compute_2值即为分组的个数,也即小计占用的行。
waterstony 2003-06-22
  • 打赏
  • 举报
回复
每页中的分组中的小计占用一行。
flythinking 2003-06-22
  • 打赏
  • 举报
回复
我的意思是:
每页中的分组中的小计所占用的行如何计算出来?
tulip2108 2003-06-21
  • 打赏
  • 举报
回复
没有描述清楚需要做什么。
取所在该分组第几行:getrow() - first(getrow() from group 1) + 1
waterstony 2003-06-20
  • 打赏
  • 举报
回复
不是很明白,可能要创建两个组,用ceiling分组实现按行数分页,new page on group break选中,再按列名分组,new page on group break选中;
flythinking 2003-06-20
  • 打赏
  • 举报
回复
up!!!

611

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧