w_rpt_edit.srw 58 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458
  1. $PBExportHeader$w_rpt_edit.srw
  2. $PBExportComments$对象属性--窗口
  3. forward
  4. global type w_rpt_edit from window
  5. end type
  6. type uo_color from uo_scolor within w_rpt_edit
  7. end type
  8. type tab_1 from tab within w_rpt_edit
  9. end type
  10. type tp_1 from userobject within tab_1
  11. end type
  12. type cb_6 from commandbutton within tp_1
  13. end type
  14. type st_msg from statictext within tp_1
  15. end type
  16. type st_2 from statictext within tp_1
  17. end type
  18. type tab_2 from tab within tp_1
  19. end type
  20. type tabpage_1 from userobject within tab_2
  21. end type
  22. type dw_6 from datawindow within tabpage_1
  23. end type
  24. type tabpage_1 from userobject within tab_2
  25. dw_6 dw_6
  26. end type
  27. type tabpage_2 from userobject within tab_2
  28. end type
  29. type dw_10 from datawindow within tabpage_2
  30. end type
  31. type dw_9 from datawindow within tabpage_2
  32. end type
  33. type tabpage_2 from userobject within tab_2
  34. dw_10 dw_10
  35. dw_9 dw_9
  36. end type
  37. type tab_2 from tab within tp_1
  38. tabpage_1 tabpage_1
  39. tabpage_2 tabpage_2
  40. end type
  41. type cbx_1 from checkbox within tp_1
  42. end type
  43. type st_1 from statictext within tp_1
  44. end type
  45. type dw_4 from datawindow within tp_1
  46. end type
  47. type cb_5 from commandbutton within tp_1
  48. end type
  49. type cb_4 from commandbutton within tp_1
  50. end type
  51. type cb_3 from commandbutton within tp_1
  52. end type
  53. type cb_right from commandbutton within tp_1
  54. end type
  55. type cb_left from commandbutton within tp_1
  56. end type
  57. type cb_divide from commandbutton within tp_1
  58. end type
  59. type cb_multiplication from commandbutton within tp_1
  60. end type
  61. type cb_minus from commandbutton within tp_1
  62. end type
  63. type cb_plus from commandbutton within tp_1
  64. end type
  65. type mle_1 from multilineedit within tp_1
  66. end type
  67. type tp_1 from userobject within tab_1
  68. cb_6 cb_6
  69. st_msg st_msg
  70. st_2 st_2
  71. tab_2 tab_2
  72. cbx_1 cbx_1
  73. st_1 st_1
  74. dw_4 dw_4
  75. cb_5 cb_5
  76. cb_4 cb_4
  77. cb_3 cb_3
  78. cb_right cb_right
  79. cb_left cb_left
  80. cb_divide cb_divide
  81. cb_multiplication cb_multiplication
  82. cb_minus cb_minus
  83. cb_plus cb_plus
  84. mle_1 mle_1
  85. end type
  86. type tp_2 from userobject within tab_1
  87. end type
  88. type dw_5 from datawindow within tp_2
  89. end type
  90. type tp_2 from userobject within tab_1
  91. dw_5 dw_5
  92. end type
  93. type tp_3 from userobject within tab_1
  94. end type
  95. type dw_8 from datawindow within tp_3
  96. end type
  97. type dw_7 from datawindow within tp_3
  98. end type
  99. type tp_3 from userobject within tab_1
  100. dw_8 dw_8
  101. dw_7 dw_7
  102. end type
  103. type tab_1 from tab within w_rpt_edit
  104. tp_1 tp_1
  105. tp_2 tp_2
  106. tp_3 tp_3
  107. end type
  108. type cb_2 from commandbutton within w_rpt_edit
  109. end type
  110. type cb_1 from commandbutton within w_rpt_edit
  111. end type
  112. type cb_20 from commandbutton within w_rpt_edit
  113. end type
  114. end forward
  115. global type w_rpt_edit from window
  116. integer y = 204
  117. integer width = 2949
  118. integer height = 1728
  119. boolean titlebar = true
  120. string title = "表达式属性窗口"
  121. boolean controlmenu = true
  122. windowtype windowtype = response!
  123. long backcolor = 80269524
  124. uo_color uo_color
  125. tab_1 tab_1
  126. cb_2 cb_2
  127. cb_1 cb_1
  128. cb_20 cb_20
  129. end type
  130. global w_rpt_edit w_rpt_edit
  131. type prototypes
  132. end prototypes
  133. type variables
  134. transaction it_report=sqlca
  135. datawindow dw1,dw2,dw3,dw5,dw4,dw7,dw8,dw9
  136. string is_oexp,is_o2exp
  137. string is_errors,iso,is_value,is_temp,is_crossmode,is_crossdata,is_data
  138. string is_format,is_type,s[10]
  139. int ii_rows,i,j,ii_rows4,ii_row
  140. str_rpt istr_rpt
  141. datastore ids,ids2
  142. DataWindowChild dw_child1,dw_child2,dw_child7,dw_child8,dw_child9
  143. robj io[]
  144. datastore idsx
  145. int iio
  146. w_rpt_main win_parent
  147. end variables
  148. forward prototypes
  149. public function integer wf_verify ()
  150. public subroutine wf_dw ()
  151. public subroutine wf_var ()
  152. public subroutine wf_sxs0 ()
  153. public function long wf_sxg0 ()
  154. public function long wf_check ()
  155. public function long wf_name ()
  156. public subroutine wf_modify ()
  157. public subroutine wf_graph ()
  158. public subroutine wf_graph2 (integer f_type)
  159. public subroutine wf_dddw (string s_dw)
  160. public subroutine wf_sxs1 (string s1, string s2, integer f_label)
  161. public function string wf_sxg1 (string s1)
  162. public subroutine wf_dw5m7 (datawindow fdw)
  163. public subroutine wf_crosstabr ()
  164. public function integer wf_crosstabw ()
  165. public function long wf_crossdata ()
  166. public subroutine wf_dwchild8 (string fs, datawindowchild fdw)
  167. public subroutine wf_read_col (string arg_cname)
  168. end prototypes
  169. public function integer wf_verify ();is_oexp=tab_1.tp_1.mle_1.text
  170. if not (pos('column,compute,band,expr,',is_type)>0 and pos('band1,band2,band3,band4',left(iso,5))=0) then
  171. if is_type='text' then
  172. wf_sxs1('text',is_oexp,1)
  173. elseif is_type='graph' then
  174. dw3.accepttext()
  175. wf_sxs1('title',dw3.getitemstring(1,'gtitle'),1)
  176. wf_sxs1('graphtype',dw3.getitemstring(1,'gtype'),1)
  177. wf_sxs1('category',dw3.getitemstring(1,'gfl'),1)
  178. wf_sxs1('category.label',dw3.getitemstring(1,'gtfl'),1)
  179. wf_sxs1('values',dw3.getitemstring(1,'gvalue'),1)
  180. wf_sxs1('values.label',dw3.getitemstring(1,'gtvalue'),1)
  181. end if
  182. return 0
  183. end if
  184. string ls_oexp,ls_o2exp
  185. is_o2exp=is_oexp
  186. ii_rows=dw1.rowcount()
  187. for i=1 to ii_rows //替换函数
  188. ls_oexp=f_replace(dw1.getitemstring(i,'func_china'),')','')
  189. ls_o2exp=f_replace(dw1.getitemstring(i,'func_english'),')','')
  190. is_o2exp=f_replace(is_o2exp,ls_oexp,ls_o2exp)
  191. next
  192. ii_rows=ids.rowcount()//ids由大到小排序是为了避免字段包含关系,如日期在前,收费日期在后
  193. for i=1 to ii_rows //替换所有字段,字段中间可以有空格,括号等
  194. ls_oexp=ids.getitemstring(i,'ctag')
  195. ls_o2exp=ids.getitemstring(i,'cname')
  196. is_o2exp=f_replace(is_o2exp,ls_oexp,ls_o2exp)
  197. next
  198. is_o2exp=f_replace(is_o2exp,'并且',' and ')
  199. is_o2exp=f_replace(is_o2exp,'或者',' or ')
  200. if is_type='expr' then return 0
  201. if pos(iso,'band_g_')=1 then//分组表达式
  202. if win_parent.ids.setsort(is_o2exp)=-1 then
  203. is_errors="表达式有错,请仔细检查表达式!"
  204. goto myerror
  205. end if
  206. if io[1].otext<>is_oexp then
  207. io[1].otext=is_oexp
  208. wf_sxs1('text',is_oexp,1)
  209. end if
  210. if io[1].ofname<>is_o2exp then
  211. io[1].ofname=is_o2exp
  212. wf_sxs1('group by',is_o2exp,1)
  213. end if
  214. else
  215. //此句作用是???
  216. //if win_parent.ids.rowcount()=0 then win_parent.ids.insertrow(0)
  217. is_value=win_parent.ids.Describe("Evaluate('"+f_replace(is_o2exp,"'","~~~'")+"',1)")
  218. if pos('?!',is_value)>0 then
  219. is_errors="表达式有错,请仔细检查表达式!"
  220. goto myerror
  221. else
  222. if pos(is_o2exp,"'")=0 then
  223. i=dw2.find("cname='"+is_o2exp+"'",1,999)
  224. else//这四行比i=dw2.find("cname='"+f_replace(is_o2exp,"'","~~~'")+"'",1,999)快
  225. i=0
  226. end if
  227. if i>0 then
  228. is_type='column'
  229. f_wsx(io[1].others,'id',string(i))
  230. wf_sxs1('id',string(i),1)
  231. if io[1].otext<>is_oexp then
  232. io[1].oname=is_o2exp//为了把column的名字设置成默认的名字,这样出现非法名的机会就大大降低
  233. wf_sxs1('name',is_o2exp,1)
  234. end if
  235. else
  236. is_type='compute'
  237. if io[1].oexpression<>is_o2exp then
  238. io[1].oexpression=is_o2exp
  239. wf_sxs1('expression',is_o2exp,1)
  240. end if
  241. end if
  242. if is_type<>io[1].otype then
  243. if is_type='column' then
  244. io[1].oexpression='edit'
  245. end if
  246. io[1].otype=is_type
  247. io[1].otext=is_oexp
  248. wf_sxs0()
  249. else
  250. if io[1].otext<>is_oexp then
  251. io[1].otext=is_oexp
  252. wf_sxs1('tag',is_oexp,1)
  253. end if
  254. end if
  255. end if
  256. end if
  257. return 0
  258. myerror:
  259. MessageBox("出错信息",is_errors+char(13)+char(13)+'翻译成英文表达式为:'+char(13)+char(13)+is_o2exp,stopsign!)
  260. return 1
  261. end function
  262. public subroutine wf_dw ();if istr_rpt.datasource<>'dw' then return
  263. datawindow ldw
  264. int li[9]
  265. for i=2 to 3
  266. choose case i
  267. case 2
  268. ldw=istr_rpt.userdw2
  269. case 3
  270. ldw=istr_rpt.userdw3
  271. end choose
  272. if isvalid(ldw) then
  273. s[1]=ldw.tag
  274. if s[1]='' then s[1]=ldw.dataobject//如果TAG名='',取dataobject名
  275. if s[1]='' then continue
  276. li[1]=long(ldw.Object.DataWindow.Column.Count)//字段总数
  277. for j=1 to li[1]
  278. s[2]=ldw.describe("#"+string(j)+'.name')//字段英文名
  279. s[3]=ldw.describe(s[2]+'_t.text')//字段中文名
  280. if pos('!?',s[3])>0 then s[3]=ldw.describe(s[2]+'.tag')
  281. if s[3]>'' and pos('!?',s[3])=0 then
  282. li[2]=dw3.insertrow(0)
  283. s[4]='前台取数("'+s[1]+'","'+s[3]+'","",1)'
  284. s[5]='f_getfromdw("'+s[1]+'","'+s[2]+'","",1)'
  285. dw3.setitem(li[2],'ctag',s[4])
  286. dw3.setitem(li[2],'cname',s[5])
  287. li[3]=ids.find("ctag='"+f_replace(s[3],"'","~~~'")+"'",1,999)
  288. if li[3]=0 then//为了翻译前台取数()的字段名
  289. li[4]=ids.insertrow(0)
  290. ids.setitem(li[4],'ctag',s[3])
  291. ids.setitem(li[4],'cname',s[2])
  292. end if
  293. end if
  294. next
  295. end if
  296. next
  297. end subroutine
  298. public subroutine wf_var ();dw3.modify("ctag_t.text='自定义变量或函数' ctype.width='0'")
  299. int li[9]
  300. s[1]=istr_rpt.uservar
  301. if pos(s[1],"打印条件=")=0 then s[1]="打印条件='',"+s[1]//打印条件为本报表设计自动添加的一个变量,在w_report_condition中赋值
  302. if s[1]>'' then
  303. if right(s[1],1)<>',' then s[1]=s[1]+','
  304. do while true
  305. li[1]=pos(s[1],',')
  306. if li[1]=0 then exit
  307. s[2]=left(s[1],li[1] -1)
  308. s[1]=mid(s[1],li[1]+1)
  309. li[1]=pos(s[2],'=')
  310. if li[1]>0 then
  311. li[2]=dw3.insertrow(0)
  312. s[2]=left(s[2],li[1] -1)
  313. dw3.setitem(li[2],'ctag',"变量('"+s[2]+"')")
  314. dw3.setitem(li[2],'cname',"f_var('"+s[2]+"')")
  315. end if
  316. loop
  317. end if
  318. end subroutine
  319. public subroutine wf_sxs0 ();///////////以下为所有属性新加代码/////////////
  320. int k,m,n,l
  321. dw5.reset()
  322. ii_rows=idsx.rowcount()
  323. k=idsx.find("otype='"+is_type+"'",1,ii_rows)
  324. if k=0 then return
  325. s[9]=io[1].others
  326. for i=k to ii_rows
  327. if idsx.object.data[i,1]<>is_type then exit
  328. m++
  329. s[2]=idsx.object.data[i,3]
  330. s[1]=idsx.object.data[i,4]
  331. choose case m
  332. case 1
  333. s[3]=io[1].otype
  334. case 2
  335. s[3]=io[1].oname
  336. case 3
  337. s[3]=io[1].oband
  338. case 4
  339. s[3]=io[1].ox1
  340. case 5
  341. s[3]=io[1].oy1
  342. case 6
  343. s[3]=io[1].ox2
  344. case 7
  345. s[3]=io[1].oy2
  346. case 8
  347. s[3]=io[1].oborder
  348. case 9
  349. s[3]=io[1].otext
  350. case 10
  351. s[3]=io[1].ocolor
  352. case 11
  353. s[3]=io[1].obcolor
  354. case 12
  355. s[3]=io[1].ofname
  356. case 13
  357. s[3]=io[1].ofsize
  358. case 14
  359. s[3]=io[1].ofweight
  360. case 15
  361. s[3]=io[1].ofitalic
  362. case 16
  363. s[3]=io[1].ofunderline
  364. case 17
  365. s[3]=io[1].oalignment
  366. case 18
  367. s[3]=io[1].oexpression
  368. end choose
  369. s[5]='{'+idsx.object.data[i,3]+'='
  370. // s[5]='{'+string(m)+'='//此行要跟win_parent.wf_sxg0()配合使用,考虑到删除属性表会有遗留问题,所以不能使用
  371. s[6]='}'
  372. n=pos(s[9],s[5])
  373. if n>0 then
  374. l=pos(s[9],s[6],n)
  375. s[8]=mid(s[9],n+len(s[5]),l -n -len(s[5]))
  376. else
  377. s[8]=''
  378. end if
  379. if m<19 then
  380. s[4]=s[8]
  381. else
  382. n=pos(s[8],char(9))
  383. if n>0 then
  384. s[3]=left(s[8],n -1)
  385. s[4]=mid(s[8],n+1)
  386. else
  387. s[3]=s[8]
  388. s[4]=''
  389. end if
  390. end if
  391. dw5.InsertRow(0)
  392. dw5.SetItem(m,1,s[1])
  393. dw5.SetItem(m,2,s[2])
  394. if idsx.object.data[i,8]=1 then//保护"表达式"不让输入
  395. if s[4]>'' then s[3]=s[3]+'~t'+s[4]
  396. dw5.SetItem(m,3,s[3])//value
  397. else
  398. dw5.SetItem(m,3,s[3])//value
  399. dw5.SetItem(m,4,s[4])//表达式
  400. end if
  401. dw5.SetItem(m,5,idsx.object.data[i,7])//保护"value"不让输入
  402. dw5.SetItem(m,6,idsx.object.data[i,8])//保护"表达式"不让输入
  403. dw5.SetItem(m,7,idsx.object.data[i,6])//obz
  404. dw5.SetItem(m,8,idsx.object.data[i,2])//osort
  405. dw5.SetItem(m,9,long(s[3]))//o01
  406. dw5.SetItem(m,10,s[3])//o02
  407. dw5.SetItem(m,11,s[3])//o03
  408. dw5.SetItem(m,12,s[3])//o04
  409. dw5.SetItem(m,13,s[3])//o05
  410. dw5.SetItem(m,14,s[3])//o06
  411. dw5.SetItem(m,15,s[3])//o07
  412. dw5.SetItem(m,16,s[3])//o08
  413. dw5.SetItem(m,17,s[3])//o09
  414. next
  415. if io[1].otype='band' then
  416. choose case left(io[1].oname,5)
  417. case 'band1','band3','band4'
  418. dw5.setfilter("pos(oproperties,'group by')+pos(oproperties,'height.autosize')+pos(oproperties,'newpage')+pos(oproperties,'resetpagecount')=0")
  419. case 'band2'
  420. dw5.setfilter("pos(oproperties,'group by')+pos(oproperties,'newpage')+pos(oproperties,'resetpagecount')=0")
  421. case else//分组
  422. dw5.setfilter("pos(oproperties,'height.autosize')=0")
  423. end choose
  424. dw5.filter()
  425. dw5.sort()
  426. end if
  427. end subroutine
  428. public function long wf_sxg0 ();string ls0,ls1,ls2,ls3
  429. ii_rows=dw5.rowcount()
  430. for i=1 to ii_rows
  431. ls0=dw5.object.data[i,2]
  432. ls1=trim(dw5.object.data[i,3])
  433. ls2=trim(dw5.object.data[i,4])
  434. choose case i
  435. case 1
  436. io[1].otype=ls1
  437. case 2
  438. io[1].oname=ls1
  439. case 3
  440. io[1].oband=ls1
  441. case 4
  442. io[1].ox1=ls1
  443. case 5
  444. io[1].oy1=ls1
  445. case 6
  446. io[1].ox2=ls1
  447. case 7
  448. io[1].oy2=ls1
  449. case 8
  450. io[1].oborder=ls1
  451. case 9
  452. io[1].otext=ls1
  453. case 10
  454. io[1].ocolor=ls1
  455. case 11
  456. io[1].obcolor=ls1
  457. case 12
  458. io[1].ofname=ls1
  459. case 13
  460. io[1].ofsize=ls1
  461. case 14
  462. io[1].ofweight=ls1
  463. case 15
  464. io[1].ofitalic=ls1
  465. case 16
  466. io[1].ofunderline=ls1
  467. case 17
  468. io[1].oalignment=ls1
  469. case 18
  470. io[1].oexpression=ls1
  471. case else//>=19
  472. if ls2>'' and pos('?!',ls2)=0 then
  473. ls2=ls1+char(9)+ls2
  474. else
  475. ls2=ls1
  476. end if
  477. end choose
  478. if i>3 and pos('?!',ls2)=0 and ls2>'' then
  479. ls3=ls3+'{'+ls0+'='+ls2+'}'
  480. // ls3=ls3+'{'+string(i)+'='+ls2+'}'//比上行快200ms左右
  481. end if
  482. next
  483. io[1].others=ls3
  484. win_parent.io[iio]=io[1]
  485. if is_type='column' then//读取values属性
  486. s[3]=''
  487. if dw8.visible=true then
  488. for i=1 to dw8.rowcount()
  489. s[1]=trim(dw8.getitemstring(i,1))
  490. s[2]=trim(dw8.getitemstring(i,2))
  491. if s[1]+s[2]>'' then s[3]=s[3]+s[1]+' '+s[2]+'/'
  492. next
  493. end if
  494. s[4]=f_rsx(io[1].others,'id')
  495. i=long(s[4])
  496. if i>0 then
  497. win_parent.dw3.setitem(i,'cvalues',s[3])
  498. end if
  499. end if
  500. return 0
  501. end function
  502. public function long wf_check ();return 0
  503. end function
  504. public function long wf_name ();//if is_type<>'datawindow' then
  505. s[3]=wf_sxg1('name')
  506. if s[3]='' then
  507. messagebox('提示','对象名不能为空!',stopsign!)
  508. return 1
  509. end if
  510. for i=1 to win_parent.iis
  511. if i<>iio and win_parent.io[i].oname=s[3] then
  512. messagebox('提示',s[3]+'对象名已经存在!',stopsign!)
  513. return 1
  514. end if
  515. next
  516. //end if
  517. return 0
  518. end function
  519. public subroutine wf_modify ();s[3]=wf_sxg1('name')
  520. if s[3]=iso or is_type='datawindow' then//对象名没改
  521. win_parent.post wf_object(iio,1)
  522. win_parent.post wf_setcolor()
  523. else//对象名已改
  524. win_parent.dw1.modify('destroy '+iso)//删除原来对象
  525. win_parent.iso=s[3]
  526. win_parent.post wf_object(iio,0)
  527. win_parent.post wf_setcolor()
  528. end if
  529. return
  530. end subroutine
  531. public subroutine wf_graph ();long l[2]
  532. l[1]=dw2.rowcount()
  533. for i=1 to l[1]
  534. is_temp=dw2.getitemstring(i,'ctype')
  535. if pos('long,decimal,double,number',left(is_temp,4))>0 then
  536. l[2]=dw_child2.insertrow(0)
  537. dw_child2.setitem(l[2],'ctag',dw2.getitemstring(i,'ctag')+'合计')
  538. is_temp=dw2.getitemstring(i,'cname')
  539. dw_child2.setitem(l[2],'cname','sum('+is_temp+' for graph)')
  540. end if
  541. next
  542. dw3.setitem(1,'gtitle',io[1].otext)
  543. dw3.setitem(1,'gtype',io[1].ofname)
  544. dw3.setitem(1,'gfl',io[1].ofsize)
  545. dw3.setitem(1,'gtfl',io[1].ofweight)
  546. dw3.setitem(1,'gvalue',io[1].ofitalic)
  547. dw3.setitem(1,'gtvalue',io[1].ofunderline)
  548. wf_graph2(long(io[1].ofname))
  549. end subroutine
  550. public subroutine wf_graph2 (integer f_type);choose case f_type
  551. case 1
  552. dw3.modify("t.x='134' t.y='155' t.text='Area'")
  553. case 2
  554. dw3.modify("t.x='197' t.y='155' t.text='Bar'")
  555. case 7
  556. dw3.modify("t.x='258' t.y='155' t.text='Column'")
  557. case 12
  558. dw3.modify("t.x='321' t.y='155' t.text='Line'")
  559. case 13
  560. dw3.modify("t.x='384' t.y='155' t.text='Pie'")
  561. case 14
  562. dw3.modify("t.x='448' t.y='155' t.text='Scatter'")
  563. case 15
  564. dw3.modify("t.x='134' t.y='237' t.text='Area'")
  565. case 3
  566. dw3.modify("t.x='197' t.y='237' t.text='Bar'")
  567. case 8
  568. dw3.modify("t.x='258' t.y='237' t.text='Column'")
  569. case 16
  570. dw3.modify("t.x='321' t.y='237' t.text='Line'")
  571. case 17
  572. dw3.modify("t.x='384' t.y='237' t.text='Pie'")
  573. case 5
  574. dw3.modify("t.x='134' t.y='316' t.text='Bar'")
  575. case 10
  576. dw3.modify("t.x='197' t.y='316' t.text='Column'")
  577. case 4
  578. dw3.modify("t.x='258' t.y='316' t.text='Bar'")
  579. case 9
  580. dw3.modify("t.x='321' t.y='316' t.text='Column'")
  581. case 6
  582. dw3.modify("t.x='384' t.y='316' t.text='Bar'")
  583. case 11
  584. dw3.modify("t.x='448' t.y='316' t.text='Column'")
  585. case else
  586. dw3.modify("t.x='999' t.y='999'")
  587. end choose
  588. end subroutine
  589. public subroutine wf_dddw (string s_dw);ids2.dataobject=s_dw
  590. dw_child7.reset()
  591. i=long(ids2.describe('DataWindow.Column.Count'))//字段总数
  592. for j=1 to i
  593. s[1]=ids2.describe("#"+string(j)+'.name')//字段英文名
  594. s[2]=trim(ids2.describe(s[1]+'_t.text'))//字段中文名
  595. if s[2]='!' then//取不到就取字段的tag名
  596. s[2]=trim(ids2.describe(s[1]+'.tag'))
  597. end if
  598. if s[2]='?' then s[2]=s[1]
  599. s[3]=ids2.describe(s[1]+'.coltype')//字段类型
  600. dw_child7.insertrow(0)
  601. dw_child7.setitem(j,1,s[1])
  602. dw_child7.setitem(j,2,s[2])
  603. dw_child7.setitem(j,3,s[3])
  604. next
  605. end subroutine
  606. public subroutine wf_sxs1 (string s1, string s2, integer f_label);i=dw5.find("oproperties='"+s1+"'",1,999)
  607. if i>0 then
  608. s[1]=dw5.object.data[i,3]
  609. if s[1]='' or (s1='radiobuttons.columns' and s[1]='0') or f_label=1 then
  610. dw5.setitem(i,3,s2)
  611. dw5.setitem(i,9,long(s2))//o01
  612. dw5.setitem(i,10,s2)//o02
  613. dw5.setitem(i,11,s2)//o03
  614. dw5.setitem(i,12,s2)//o04
  615. dw5.setitem(i,13,s2)//o05
  616. dw5.setitem(i,14,s2)//o06
  617. dw5.setitem(i,15,s2)//o07
  618. dw5.setitem(i,16,s2)//o08
  619. dw5.setitem(i,17,s2)//o09
  620. end if
  621. end if
  622. end subroutine
  623. public function string wf_sxg1 (string s1);i=dw5.find("oproperties='"+s1+"'",1,999)
  624. if i>0 then
  625. s[1]=dw5.object.data[i,3]
  626. else
  627. s[1]=''
  628. end if
  629. return s[1]
  630. end function
  631. public subroutine wf_dw5m7 (datawindow fdw);s[1] = fdw.Object.datawindow.objects+'~t'
  632. DO WHILE TRUE
  633. i = Pos(s[1],Char(9)) //tab
  634. IF i = 0 THEN EXIT
  635. s[2] = Trim(Left(s[1],i -1))
  636. s[1] = Mid(s[1],i+1)
  637. i = Long(fdw.Describe(s[2]+'.x'))
  638. IF i > 640 THEN
  639. fdw.Modify(s[2]+".x='"+fdw.Object.ovalue1.X+"'")
  640. fdw.Modify(s[2]+".width='"+fdw.Object.ovalue1.Width+"'")
  641. END IF
  642. LOOP
  643. end subroutine
  644. public subroutine wf_crosstabr ();string ls2[],ls3[],ls4[],ls
  645. datawindow ldw
  646. tab_1.tp_2.visible=false
  647. tab_1.tp_1.text='Crosstab(交叉表)属性'
  648. int liw,lih
  649. liw=tab_1.tp_1.width
  650. lih=tab_1.tp_1.height -80
  651. dw1.x=0
  652. dw1.y=0
  653. dw1.width=liw/2
  654. dw1.height=lih*2/3// -80
  655. dw1.dataobject='dw_rpt_column'
  656. dw1.modify("ctag_t.text='source data(数据源列名)'")
  657. dw2.x=liw/2
  658. dw2.y=lih/3
  659. dw2.width=liw/2
  660. dw2.height=lih/3
  661. dw2.modify("ctag_t.text='columns(各列列名)'")
  662. dw3.x=0
  663. dw3.y=lih*2/3
  664. dw3.width=liw/2
  665. dw3.height=lih/3
  666. dw3.modify("ctag_t.text='rows(各行行名)'")
  667. dw4.x=liw/2
  668. dw4.y=lih*2/3
  669. dw4.width=liw/2
  670. dw4.height=lih/3
  671. dw4.modify("ctag_t.text='values(列值)'")
  672. tab_1.tp_1.st_1.x=liw/2+60
  673. tab_1.tp_1.st_1.y=60
  674. tab_1.tp_1.st_1.width=liw/2
  675. tab_1.tp_1.st_1.height=lih/3 -60
  676. tab_1.tp_1.mle_1.visible=false
  677. tab_1.tp_1.st_1.text='1)拖动字段到columns,rows,values中~n~n2)双击进入修改表达式'
  678. tab_1.tp_1.cbx_1.text='Rebuild at runtime(运行时重建列,列不固定模式)'
  679. if istr_rpt.rsql2>'' then//兼容含参数的情况
  680. f_rpt_gdw(istr_rpt.rsql2,dw1,it_report,'','')
  681. elseif istr_rpt.rsqlselect>'' then
  682. f_rpt_gdw(istr_rpt.rsqlselect,dw1,it_report,'','')
  683. end if
  684. j=dw1.rowcount()
  685. for i=1 to j
  686. dw1.setitem(i,'ckey',dw1.getitemstring(i,'cname'))
  687. dw1.setitem(i,'cupdate',dw1.getitemstring(i,'ctag'))
  688. next
  689. f_atab(ls2[],f_replace(f_rsx(io[1].others,'crosstab.columns'),',','~t')+'~t')
  690. f_atab(ls3[],f_replace(f_rsx(io[1].others,'crosstab.rows'),',','~t')+'~t')
  691. f_atab(ls4[],f_replace(f_rsx(io[1].others,'crosstab.values'),',','~t')+'~t')
  692. j=upperbound(ls2[])
  693. dwobject ldwo
  694. for i=1 to j
  695. ii_row=dw1.find("cname='"+ls2[i]+"'",1,999)
  696. if ii_row=0 then
  697. ii_row=dw1.find("right(cname,"+string(len(ls2[i])+1)+")='_"+ls2[i]+"'",1,999)
  698. end if
  699. if ii_row>0 then
  700. dw1.RowsCopy(ii_row,ii_row,primary!,dw2,dw2.RowCount()+1,primary!)
  701. end if
  702. next
  703. j=upperbound(ls3[])
  704. for i=1 to j
  705. ii_row=dw1.find("cname='"+ls3[i]+"'",1,999)
  706. if ii_row=0 then
  707. ii_row=dw1.find("right(cname,"+string(len(ls3[i])+1)+")='_"+ls3[i]+"'",1,999)
  708. end if
  709. if ii_row>0 then
  710. dw1.RowsCopy(ii_row,ii_row,primary!,dw3,dw3.RowCount()+1,primary!)
  711. end if
  712. next
  713. j=upperbound(ls4[])
  714. for i=1 to j
  715. ls=ls4[i]
  716. ls=trim(f_replace(ls,'sum(',''))
  717. ls=trim(f_replace(ls,'count(',''))
  718. ls=trim(f_replace(ls,'for crosstab)',''))
  719. ii_row=dw1.find("cname='"+ls+"'",1,999)
  720. if ii_row=0 then
  721. ii_row=dw1.find("right(cname,"+string(len(ls)+1)+")='_"+ls+"'",1,999)
  722. end if
  723. if ii_row>0 then
  724. dw1.RowsCopy(ii_row,ii_row,primary!,dw4,dw4.RowCount()+1,primary!)
  725. ii_row=dw4.rowcount()
  726. if ii_row>0 then
  727. is_temp=dw4.getitemstring(ii_row,'ctype')
  728. if pos('decimal,number,long,',left(is_temp,7))>0 then
  729. is_temp='求和('+dw4.getitemstring(ii_row,'ctag')+' for crosstab)'
  730. dw4.setitem(ii_row,'ctag',is_temp)
  731. is_temp='sum('+dw4.getitemstring(ii_row,'cname')+' for crosstab)'
  732. dw4.setitem(ii_row,'cname',is_temp)
  733. else
  734. is_temp='计数('+dw4.getitemstring(ii_row,'ctag')+' for crosstab)'
  735. dw4.setitem(ii_row,'ctag',is_temp)
  736. is_temp='count('+dw4.getitemstring(ii_row,'cname')+' for crosstab)'
  737. dw4.setitem(ii_row,'cname',is_temp)
  738. end if
  739. end if
  740. else//sum(sl*lsj for crosstab)情况
  741. ldw=win_parent.dw3
  742. ii_row=dw3.rowcount()+i
  743. if ldw.rowcount()>=ii_row then
  744. is_temp=ldw.getitemstring(ii_row,'ctype')
  745. if pos(',number,',left(is_temp,7))>0 then
  746. ldw.RowsCopy(ii_row,ii_row,primary!,dw4,dw4.RowCount()+1,primary!)
  747. ii_row=dw4.rowcount()
  748. if ii_row>0 then
  749. dw4.setitem(ii_row,'ckey',dw4.getitemstring(ii_row,'cname'))
  750. dw4.setitem(ii_row,'cupdate',dw4.getitemstring(ii_row,'ctag'))
  751. dw4.setitem(ii_row,'ctag',ls4[i])
  752. dw4.setitem(ii_row,'cname',ls4[i])
  753. end if
  754. end if
  755. end if
  756. end if
  757. next
  758. is_crossmode=f_rsx(io[1].others,'crosstab.dynamic')
  759. if is_crossmode='yes' then
  760. tab_1.tp_1.cbx_1.checked=true
  761. end if
  762. end subroutine
  763. public function integer wf_crosstabw ();string ls[]
  764. datawindow ldw
  765. if tab_1.tp_1.cbx_1.checked=true then
  766. is_crossmode='yes'
  767. else
  768. is_crossmode='no'
  769. end if
  770. wf_sxs1('crosstab.dynamic',is_crossmode,1)
  771. for j=1 to 4
  772. choose case j
  773. case 1
  774. ldw=dw1
  775. ls[9]='crosstab.sourcenames'
  776. ls[10]='请选择数据源!'
  777. case 2
  778. ldw=dw2
  779. ls[9]='crosstab.columns'
  780. ls[10]='请选择columns!'
  781. if is_crossmode='no' then//对于列静态模式
  782. if wf_crossdata()=1 then
  783. ls[10]='对于列静态模式,数据源的表中要有记录!'
  784. goto myerror
  785. end if
  786. end if
  787. case 3
  788. ldw=dw3
  789. ls[9]='crosstab.rows'
  790. ls[10]='请选择rows!'
  791. case 4
  792. ldw=dw4
  793. ls[9]='crosstab.values'
  794. ls[10]='请选择values!'
  795. end choose
  796. ii_rows=ldw.rowcount()
  797. if ii_rows=0 then goto myerror
  798. for i=1 to ii_rows
  799. ls[j]=ls[j]+','+ldw.getitemstring(i,2)
  800. next
  801. ls[j]=mid(ls[j],2)
  802. wf_sxs1(ls[9],ls[j],1)
  803. next
  804. win_parent.wf_crosstabc()
  805. iio=win_parent.iio
  806. return 0
  807. myerror:
  808. messagebox('提示',ls[10])
  809. return 1
  810. end function
  811. public function long wf_crossdata ();string ls_field,ls_sql,ls_get
  812. int li_rows
  813. li_rows=dw4.rowcount()
  814. is_crossdata=''
  815. is_data=''
  816. ii_rows=dw2.rowcount()
  817. for i=2 to ii_rows//暂时只考虑1个columns的情况,因为2个以上的算法比较复杂
  818. dw2.deleterow(2)
  819. next
  820. if ii_rows>0 then
  821. ls_field=dw2.getitemstring(1,'cdbname')
  822. ls_sql='select DISTINCT '+ls_field+' from '+left(ls_field,pos(ls_field,'.') -1)+' order by '+ls_field
  823. prepare sqlsa from :ls_sql using it_report;
  824. describe sqlsa into sqlda;
  825. declare my_cursor dynamic cursor for sqlsa;
  826. open dynamic my_cursor using descriptor sqlda;
  827. do while true
  828. fetch my_cursor using descriptor sqlda;
  829. if sqlda.numoutputs>0 and sqlca.sqlcode=0 then
  830. choose case sqlda.outparmtype[1]
  831. case TypeString!
  832. if it_report.sqlcode=0 then ls_get=GetDynamicString(sqlda,1)
  833. case TypeDate!
  834. if it_report.sqlcode=0 then ls_get=string(GetDynamicDate(sqlda,1),'yyyy/mm/dd')
  835. case TypeDateTime!
  836. if it_report.sqlcode=0 then ls_get=string(GetDynamicDatetime(sqlda,1))
  837. case TypeDecimal!,TypeDouble!,TypeInteger!,TypeLong!,TypeReal!
  838. if it_report.sqlcode=0 then ls_get=string(GetDynamicNumber(sqlda,1))
  839. case TypeTime!
  840. if it_report.sqlcode=0 then ls_get=string(GetDynamicTime(sqlda,1))
  841. end choose
  842. is_data=is_data+'~t'+ls_get
  843. is_crossdata=is_crossdata+'~t'+ls_get
  844. for i=2 to li_rows
  845. is_crossdata=is_crossdata+'~t'+ls_get
  846. next
  847. else
  848. exit
  849. end if
  850. loop
  851. close my_cursor;
  852. if is_crossdata='' then
  853. return 1
  854. end if
  855. is_data=mid(is_data,2)
  856. is_crossdata="crosstabdata='"+mid(is_crossdata,2)+"'"
  857. wf_sxs1('crosstabdata',is_crossdata,1)
  858. end if
  859. return 0
  860. end function
  861. public subroutine wf_dwchild8 (string fs, datawindowchild fdw);s[4] = LibraryDirectory(fs,DirDataWindow!) //name ~t date/time modified ~t comments ~n
  862. fdw.Reset()
  863. DO WHILE TRUE
  864. j = Pos(s[4],'~t')
  865. IF j = 0 THEN EXIT
  866. s[1] = Left(s[4],j -1)
  867. s[4] = Mid(s[4],j+1)
  868. j = Pos(s[4],'~t')
  869. s[3] = Left(s[4],j -1)
  870. s[4] = Mid(s[4],j+1)
  871. j = Pos(s[4],'~n')
  872. s[2] = Left(s[4],j -1)
  873. s[4] = Mid(s[4],j+1)
  874. j = fdw.InsertRow(0)
  875. fdw.SetItem(j,1,s[1])
  876. fdw.SetItem(j,2,s[2])
  877. fdw.SetItem(j,3,s[3])
  878. LOOP
  879. fdw.SetSort('ctag a')
  880. fdw.Sort()
  881. FOR j = fdw.RowCount() TO 12
  882. fdw.InsertRow(0) //在PB6.5下,如果dddw的allow edit=true以及下拉行数指定,则需要此三行代码,否则多记录时只显示1行
  883. NEXT
  884. end subroutine
  885. public subroutine wf_read_col (string arg_cname);/////用于说明字段
  886. Long ll_count
  887. IF Pos(arg_cname,"'") = 0 THEN
  888. ll_count = dw2.Find("cname='"+arg_cname+"'",1,999)
  889. IF ll_count > 0 THEN
  890. tab_1.tp_1.st_msg.Text = dw2.Object.ctag[ll_count]
  891. END IF
  892. END IF
  893. return
  894. end subroutine
  895. on w_rpt_edit.create
  896. this.uo_color=create uo_color
  897. this.tab_1=create tab_1
  898. this.cb_2=create cb_2
  899. this.cb_1=create cb_1
  900. this.cb_20=create cb_20
  901. this.Control[]={this.uo_color,&
  902. this.tab_1,&
  903. this.cb_2,&
  904. this.cb_1,&
  905. this.cb_20}
  906. end on
  907. on w_rpt_edit.destroy
  908. destroy(this.uo_color)
  909. destroy(this.tab_1)
  910. destroy(this.cb_2)
  911. destroy(this.cb_1)
  912. destroy(this.cb_20)
  913. end on
  914. event open;win_parent = this.parentwindow()
  915. f_wcenter(THIS)
  916. istr_rpt = Message.PowerObjectParm
  917. it_report = istr_rpt.transation
  918. idsx = win_parent.idsx
  919. ids2 = CREATE datastore //wf_dddw()取下拉字段列表用
  920. iio = win_parent.iio
  921. io[1] = win_parent.io[iio]
  922. iso = io[1].oname
  923. is_type = io[1].otype
  924. if is_type <> 'column' and is_type <> 'datawindow' and &
  925. Pos('libexport,libimport',is_type) = 0 and &
  926. Pos('report',is_type) = 0 then
  927. tab_1.tp_3.visible = false
  928. end if
  929. //dw1=tab_1.tp_1.dw_1
  930. //dw2=tab_1.tp_1.dw_2
  931. //dw3=tab_1.tp_1.dw_3
  932. dw1 = tab_1.tp_1.tab_2.tabpage_2.dw_9
  933. dw2 = tab_1.tp_1.tab_2.tabpage_1.dw_6
  934. dw3 = tab_1.tp_1.tab_2.tabpage_2.dw_10
  935. dw4 = tab_1.tp_1.dw_4 //crosstab用到
  936. dw5 = tab_1.tp_2.dw_5
  937. dw7 = tab_1.tp_3.dw_7
  938. dw8 = tab_1.tp_3.dw_8
  939. dw7.GetChild('odddwcolumn',dw_child7)
  940. dw7.GetChild('odddwname',dw_child8)
  941. dw5.GetChild('odddwname',dw_child9)
  942. dw5.ShareData(dw7)
  943. IF istr_rpt.tt = 'expr' THEN
  944. Y = Y+80
  945. Title = '表达式'
  946. tab_1.tp_2.Visible = FALSE
  947. tab_1.tp_3.Visible = FALSE
  948. is_type = istr_rpt.tt
  949. io[1].otext = istr_rpt.t1
  950. IF istr_rpt.t2 = 'expr' THEN
  951. tab_1.tp_1.cbx_1.Checked = TRUE
  952. END IF
  953. ELSE
  954. CHOOSE CASE is_type
  955. CASE 'line'
  956. Title = '线条属性'
  957. tab_1.tp_1.Visible = FALSE
  958. CASE 'groupbox'
  959. Title = '分组框属性'
  960. tab_1.tp_1.Visible = FALSE
  961. CASE 'ellipse'
  962. Title = '椭圆属性'
  963. tab_1.tp_1.Visible = FALSE
  964. CASE 'roundrectangle'
  965. Title = '圆角矩形属性'
  966. tab_1.tp_1.Visible = FALSE
  967. CASE 'button'
  968. Title = '按钮属性'
  969. tab_1.tp_1.Visible = FALSE
  970. CASE 'bitmap'
  971. Title = '位图属性'
  972. tab_1.tp_1.Visible = FALSE
  973. CASE 'tableblob'
  974. Title = 'tableblob属性'
  975. tab_1.tp_1.Visible = FALSE
  976. CASE 'report'
  977. Title = 'report属性'
  978. tab_1.tp_1.Visible = FALSE
  979. CASE 'datawindow'
  980. Title = 'datawindow属性'
  981. IF istr_rpt.tt = 'crosstab' THEN
  982. wf_crosstabr()
  983. ELSE //crosstab
  984. tab_1.tp_1.Visible = FALSE
  985. END IF
  986. CASE 'band'
  987. IF Pos(iso,'band_g_') = 1 THEN
  988. Title = '分组表达式'
  989. ELSE
  990. Title = io[1].oband+'属性'
  991. tab_1.tp_1.Visible = FALSE
  992. tab_1.POST SelectTab(2)
  993. END IF
  994. CASE 'text'
  995. Title = '文本属性'
  996. tab_1.tp_1.Text = '文本'
  997. dw1.Visible = FALSE
  998. dw3.Visible = FALSE
  999. tab_1.tp_1.mle_1.Height = tab_1.tp_1.mle_1.Height+100
  1000. CASE 'graph'
  1001. Title = '统计图属性'
  1002. tab_1.tp_1.Text = '统计图属性'
  1003. dw3.X = 0
  1004. dw3.Y = 0
  1005. dw3.Width = tab_1.tp_1.Width
  1006. dw3.Height = tab_1.tp_1.Height
  1007. dw3.HSplitScroll = FALSE
  1008. dw3.HScrollBar = FALSE
  1009. dw3.Border = FALSE
  1010. dw3.DataObject = 'dw_rpt_graph'
  1011. dw3.InsertRow(0)
  1012. CASE 'libexport','libimport'
  1013. IF is_type = 'libexport' THEN
  1014. Title = '引出的数据窗口名'
  1015. ELSE
  1016. Title = '引入的数据窗口名'
  1017. END IF
  1018. tab_1.tp_3.Text = Title
  1019. tab_1.tp_1.Visible = FALSE
  1020. tab_1.tp_2.Visible = FALSE
  1021. tab_1.POST SelectTab(3)
  1022. RETURN
  1023. END CHOOSE
  1024. END IF
  1025. IF Pos('column,compute,',is_type) = 0 THEN
  1026. tab_1.tp_3.Visible = FALSE
  1027. END IF
  1028. IF Pos('column,compute,band,text,graph,expr,',is_type) > 0 THEN
  1029. is_oexp = io[1].otext
  1030. tab_1.tp_1.mle_1.Text = is_oexp
  1031. tab_1.tp_1.mle_1.SelectText(1,Len(tab_1.tp_1.mle_1.text))
  1032. tab_1.tp_1.mle_1.SetFocus()
  1033. IF istr_rpt.t2 = 'crossvalue' THEN
  1034. f_rpt_gdw(istr_rpt.rsqlselect,dw2,it_report,'','')
  1035. ELSE
  1036. win_parent.dw3.RowsCopy(1,win_parent.dw3.RowCount(),Primary!,dw2,1,Primary!)
  1037. END IF
  1038. IF istr_rpt.Text = '0' AND Pos('column,compute,band,',is_type) > 0 THEN //不进行翻译
  1039. CHOOSE CASE is_type
  1040. CASE 'column'
  1041. i = Long(f_rsx(io[1].others,'id'))
  1042. IF i > 0 THEN is_oexp = f_myget(dw2,i,'cname')
  1043. CASE 'compute'
  1044. is_oexp = io[1].oexpression
  1045. CASE 'band'
  1046. is_oexp = io[1].ofsize
  1047. END CHOOSE
  1048. tab_1.tp_1.mle_1.Text = is_oexp
  1049. ii_rows = dw2.RowCount()
  1050. FOR i = 1 TO ii_rows
  1051. dw2.SetItem(i,1,dw2.GetItemString(i,2))
  1052. NEXT
  1053. END IF
  1054. IF Pos('graph',is_type) > 0 THEN
  1055. dw3.GetChild('gfl',dw_child1)
  1056. dw3.GetChild('gvalue',dw_child2)
  1057. dw2.ShareData(dw_child1)
  1058. wf_graph()
  1059. ELSE
  1060. wf_var()
  1061. END IF
  1062. ids = CREATE datastore
  1063. ids.DataObject = dw2.DataObject
  1064. dw2.RowsCopy(1,dw2.RowCount(),Primary!,ids,1,Primary!)
  1065. IF Pos('graph',is_type) = 0 THEN
  1066. wf_dw()
  1067. END IF
  1068. ids.SetSort("len(ctag) D") //中文名长度按降序索引
  1069. ids.Sort()
  1070. dw2.ScrollToRow(1)
  1071. dw3.ScrollToRow(1)
  1072. dw2.SetSort("ctag D")
  1073. dw2.Sort()
  1074. ELSEIF Pos('datawindow',is_type) > 0 THEN
  1075. IF istr_rpt.tt <> 'crosstab' THEN
  1076. tab_1.POST SelectTab(2)
  1077. END IF
  1078. ELSE
  1079. tab_1.POST SelectTab(2)
  1080. END IF
  1081. wf_sxs0()
  1082. IF Pos(',datawindow,expr,',is_type) = 0 THEN Title = Title+'(对象名: '+iso+')'
  1083. IF is_type = 'column' THEN
  1084. tab_1.EVENT SelectionChanging(1,3)
  1085. END IF
  1086. wf_read_col(is_oexp)
  1087. RETURN
  1088. f_getfromdw('','','',1) //为了编译后不会丢失此函数
  1089. f_getfromtable('','','',1)
  1090. f_convert(0)
  1091. f_var('')
  1092. end event
  1093. event closequery;destroy ids
  1094. destroy ids2
  1095. end event
  1096. type uo_color from uo_scolor within w_rpt_edit
  1097. boolean visible = false
  1098. integer x = 1925
  1099. integer y = 324
  1100. integer taborder = 40
  1101. end type
  1102. event ue_close;call super::ue_close;int li_row
  1103. li_row=dw5.getrow()
  1104. if li_row>0 then
  1105. dw5.setitem(li_row,'ovalue1',is_color)
  1106. end if
  1107. end event
  1108. type tab_1 from tab within w_rpt_edit
  1109. event create ( )
  1110. event destroy ( )
  1111. integer width = 2944
  1112. integer height = 1516
  1113. integer taborder = 10
  1114. integer textsize = -9
  1115. integer weight = 400
  1116. fontpitch fontpitch = variable!
  1117. string facename = "宋体"
  1118. long backcolor = 80269524
  1119. boolean fixedwidth = true
  1120. alignment alignment = center!
  1121. integer selectedtab = 1
  1122. tp_1 tp_1
  1123. tp_2 tp_2
  1124. tp_3 tp_3
  1125. end type
  1126. on tab_1.create
  1127. this.tp_1=create tp_1
  1128. this.tp_2=create tp_2
  1129. this.tp_3=create tp_3
  1130. this.Control[]={this.tp_1,&
  1131. this.tp_2,&
  1132. this.tp_3}
  1133. end on
  1134. on tab_1.destroy
  1135. destroy(this.tp_1)
  1136. destroy(this.tp_2)
  1137. destroy(this.tp_3)
  1138. end on
  1139. event selectionchanging;IF newindex > 1 THEN
  1140. //if isvalid(dw5) then
  1141. dw5.SetRedraw(FALSE)
  1142. dw5.SetFilter('') //为了保证能找到Tag
  1143. dw5.Filter()
  1144. wf_verify() //主要是为了设置COLUMN的默认名字
  1145. dw5.SetRedraw(TRUE)
  1146. //end if
  1147. END IF
  1148. dwobject ldwo
  1149. IF is_type = 'column' THEN //为了设置EDIT.TYPE
  1150. CHOOSE CASE newindex
  1151. CASE 2
  1152. i = dw5.Find("#2='edit.style'",1,999)
  1153. IF i > 0 THEN dw5.EVENT ItemChanged(i,ldwo,dw5.Object.Data[i,3])
  1154. CASE 3
  1155. dw5.SetRedraw(FALSE)
  1156. dw5.SetFilter('')
  1157. dw5.Filter()
  1158. i = dw7.Find("#2='edit.style'",1,999)
  1159. IF i > 0 THEN dw7.EVENT ItemChanged(i,ldwo,dw7.Object.Data[i,3])
  1160. END CHOOSE
  1161. ELSEIF is_type = 'datawindow' THEN
  1162. CHOOSE CASE newindex
  1163. CASE 2
  1164. i = dw5.Find("#2='processing'",1,999)
  1165. IF i > 0 THEN dw5.EVENT ItemChanged(i,ldwo,dw5.Object.Data[i,3])
  1166. CASE 1
  1167. IF oldindex > 1 THEN
  1168. i = dw5.Find("#2='processing'",1,999)
  1169. IF i > 0 THEN
  1170. IF dw5.GetItemString(i,3) <> '4' THEN
  1171. MessageBox('提示','Crosstab风格才有此设置')
  1172. RETURN 1
  1173. END IF
  1174. END IF
  1175. END IF
  1176. END CHOOSE
  1177. ELSEIF Pos('libexport,libimport',is_type) > 0 THEN
  1178. IF dw7.RowCount() = 0 THEN
  1179. dw7.Modify("datawindow.header.height='0'")
  1180. dw8.Visible = FALSE
  1181. dw5.InsertRow(0)
  1182. dw5.InsertRow(0)
  1183. s[1] = 'ljerp1_printbill_cust.pbd'
  1184. dw5.SetItem(1,3,s[1])
  1185. dw5.SetItem(1,1,'选择PBL或PBD文件名')
  1186. dw5.SetItem(1,5,1)
  1187. dw5.SetItem(1,6,1)
  1188. dw5.SetItem(1,'osort',1)
  1189. dw5.SetItem(2,2,'dataobject')
  1190. dw5.SetItem(2,1,'选择或输入数据窗口名')
  1191. dw5.SetItem(2,6,1)
  1192. dw5.SetItem(2,'osort',2)
  1193. wf_dwchild8(s[1],dw_child8)
  1194. dw7.ScrollToRow(2)
  1195. // dw7.width = 2300
  1196. // dw7.Modify("odddwname.width=230")
  1197. //
  1198. // IF is_type = 'libexport' THEN
  1199. // datawindow ldw
  1200. // ldw = w_bill_rpt_def.dw_report
  1201. // IF IsValid(ldw) THEN
  1202. // i = ldw.GetRow()
  1203. // IF i > 0 THEN
  1204. // s[1] = ldw.GetItemString(i,'rpname')
  1205. // dw5.SetItem(2,3,s[1])
  1206. // END IF
  1207. // END IF
  1208. // END IF
  1209. END IF
  1210. ELSEIF Pos('report',is_type) > 0 THEN
  1211. IF dw_child9.RowCount() = 0 THEN
  1212. wf_dwchild8('ljerp1_printbill_cust.pbd',dw_child9)
  1213. END IF
  1214. ELSE
  1215. IF newindex = 3 THEN
  1216. MessageBox('提示','column才有此设置')
  1217. RETURN 1
  1218. END IF
  1219. END IF
  1220. end event
  1221. type tp_1 from userobject within tab_1
  1222. integer x = 18
  1223. integer y = 96
  1224. integer width = 2907
  1225. integer height = 1404
  1226. long backcolor = 80269524
  1227. string text = "表达式"
  1228. long tabtextcolor = 33554432
  1229. long tabbackcolor = 80269524
  1230. long picturemaskcolor = 536870912
  1231. cb_6 cb_6
  1232. st_msg st_msg
  1233. st_2 st_2
  1234. tab_2 tab_2
  1235. cbx_1 cbx_1
  1236. st_1 st_1
  1237. dw_4 dw_4
  1238. cb_5 cb_5
  1239. cb_4 cb_4
  1240. cb_3 cb_3
  1241. cb_right cb_right
  1242. cb_left cb_left
  1243. cb_divide cb_divide
  1244. cb_multiplication cb_multiplication
  1245. cb_minus cb_minus
  1246. cb_plus cb_plus
  1247. mle_1 mle_1
  1248. end type
  1249. on tp_1.create
  1250. this.cb_6=create cb_6
  1251. this.st_msg=create st_msg
  1252. this.st_2=create st_2
  1253. this.tab_2=create tab_2
  1254. this.cbx_1=create cbx_1
  1255. this.st_1=create st_1
  1256. this.dw_4=create dw_4
  1257. this.cb_5=create cb_5
  1258. this.cb_4=create cb_4
  1259. this.cb_3=create cb_3
  1260. this.cb_right=create cb_right
  1261. this.cb_left=create cb_left
  1262. this.cb_divide=create cb_divide
  1263. this.cb_multiplication=create cb_multiplication
  1264. this.cb_minus=create cb_minus
  1265. this.cb_plus=create cb_plus
  1266. this.mle_1=create mle_1
  1267. this.Control[]={this.cb_6,&
  1268. this.st_msg,&
  1269. this.st_2,&
  1270. this.tab_2,&
  1271. this.cbx_1,&
  1272. this.st_1,&
  1273. this.dw_4,&
  1274. this.cb_5,&
  1275. this.cb_4,&
  1276. this.cb_3,&
  1277. this.cb_right,&
  1278. this.cb_left,&
  1279. this.cb_divide,&
  1280. this.cb_multiplication,&
  1281. this.cb_minus,&
  1282. this.cb_plus,&
  1283. this.mle_1}
  1284. end on
  1285. on tp_1.destroy
  1286. destroy(this.cb_6)
  1287. destroy(this.st_msg)
  1288. destroy(this.st_2)
  1289. destroy(this.tab_2)
  1290. destroy(this.cbx_1)
  1291. destroy(this.st_1)
  1292. destroy(this.dw_4)
  1293. destroy(this.cb_5)
  1294. destroy(this.cb_4)
  1295. destroy(this.cb_3)
  1296. destroy(this.cb_right)
  1297. destroy(this.cb_left)
  1298. destroy(this.cb_divide)
  1299. destroy(this.cb_multiplication)
  1300. destroy(this.cb_minus)
  1301. destroy(this.cb_plus)
  1302. destroy(this.mle_1)
  1303. end on
  1304. type cb_6 from commandbutton within tp_1
  1305. integer x = 1189
  1306. integer y = 288
  1307. integer width = 128
  1308. integer height = 76
  1309. integer taborder = 100
  1310. integer textsize = -9
  1311. integer weight = 400
  1312. fontcharset fontcharset = gb2312charset!
  1313. fontpitch fontpitch = variable!
  1314. string facename = "宋体"
  1315. string text = "全选"
  1316. end type
  1317. event clicked;tab_1.tp_1.mle_1.SetFocus()
  1318. tab_1.tp_1.mle_1.SelectText(1,Len(tab_1.tp_1.mle_1.text))
  1319. end event
  1320. type st_msg from statictext within tp_1
  1321. integer x = 1847
  1322. integer y = 304
  1323. integer width = 1051
  1324. integer height = 48
  1325. integer textsize = -9
  1326. integer weight = 400
  1327. fontcharset fontcharset = gb2312charset!
  1328. fontpitch fontpitch = variable!
  1329. string facename = "宋体"
  1330. long textcolor = 255
  1331. long backcolor = 67108864
  1332. boolean focusrectangle = false
  1333. end type
  1334. type st_2 from statictext within tp_1
  1335. integer x = 1600
  1336. integer y = 304
  1337. integer width = 270
  1338. integer height = 48
  1339. integer textsize = -9
  1340. integer weight = 400
  1341. fontcharset fontcharset = gb2312charset!
  1342. fontpitch fontpitch = variable!
  1343. string facename = "宋体"
  1344. long textcolor = 255
  1345. long backcolor = 67108864
  1346. string text = "字段说明:"
  1347. boolean focusrectangle = false
  1348. end type
  1349. type tab_2 from tab within tp_1
  1350. integer y = 372
  1351. integer width = 2898
  1352. integer height = 948
  1353. integer taborder = 50
  1354. integer textsize = -9
  1355. integer weight = 400
  1356. fontcharset fontcharset = gb2312charset!
  1357. fontpitch fontpitch = variable!
  1358. string facename = "宋体"
  1359. long backcolor = 80269524
  1360. boolean raggedright = true
  1361. boolean focusonbuttondown = true
  1362. integer selectedtab = 1
  1363. tabpage_1 tabpage_1
  1364. tabpage_2 tabpage_2
  1365. end type
  1366. on tab_2.create
  1367. this.tabpage_1=create tabpage_1
  1368. this.tabpage_2=create tabpage_2
  1369. this.Control[]={this.tabpage_1,&
  1370. this.tabpage_2}
  1371. end on
  1372. on tab_2.destroy
  1373. destroy(this.tabpage_1)
  1374. destroy(this.tabpage_2)
  1375. end on
  1376. type tabpage_1 from userobject within tab_2
  1377. integer x = 18
  1378. integer y = 96
  1379. integer width = 2862
  1380. integer height = 836
  1381. long backcolor = 80269524
  1382. string text = "字段"
  1383. long tabtextcolor = 33554432
  1384. long tabbackcolor = 80269524
  1385. long picturemaskcolor = 536870912
  1386. dw_6 dw_6
  1387. end type
  1388. on tabpage_1.create
  1389. this.dw_6=create dw_6
  1390. this.Control[]={this.dw_6}
  1391. end on
  1392. on tabpage_1.destroy
  1393. destroy(this.dw_6)
  1394. end on
  1395. type dw_6 from datawindow within tabpage_1
  1396. integer width = 2853
  1397. integer height = 840
  1398. integer taborder = 11
  1399. string dataobject = "dw_rpt_column"
  1400. boolean hscrollbar = true
  1401. boolean vscrollbar = true
  1402. boolean livescroll = true
  1403. borderstyle borderstyle = stylelowered!
  1404. end type
  1405. event clicked;IF row = 0 THEN RETURN
  1406. IF Pos('text,column,compute,band,expr,',is_type) > 0 THEN
  1407. IF tab_1.tp_1.cbx_1.Checked = TRUE THEN
  1408. is_temp = 'cname'
  1409. ELSE
  1410. is_temp = 'ctag'
  1411. END IF
  1412. tab_1.tp_1.mle_1.ReplaceText(GetItemString(row,is_temp))
  1413. tab_1.tp_1.mle_1.SetFocus()
  1414. tab_1.tp_1.mle_1.SelectText(pos(tab_1.tp_1.mle_1.text,GetItemString(row,is_temp)),Len(GetItemString(row,is_temp)))
  1415. ELSEIF Pos('datawindow',is_type) > 0 THEN
  1416. SelectRow(0,FALSE)
  1417. SelectRow(row,TRUE)
  1418. Drag(Begin!)
  1419. END IF
  1420. wf_read_col(GetItemString(row,is_temp))
  1421. end event
  1422. event dragdrop;if pos('datawindow',is_type)>0 then
  1423. DragObject ldo
  1424. DataWindow ldw
  1425. ldo=DraggedObject()
  1426. if TypeOf(ldo)=DataWindow! then
  1427. ldw=ldo
  1428. if ldw.classname()='dw_1' then
  1429. dw1.RowsCopy(dw1.getrow(),dw1.getrow(),primary!,this,this.RowCount()+1,primary!)
  1430. end if
  1431. end if
  1432. end if
  1433. end event
  1434. event rowfocuschanged;if pos('text,column,compute,band,expr,',is_type)>0 then
  1435. if currentrow>0 then
  1436. this.SelectRow(0,False)
  1437. this.SelectRow(currentrow,true)
  1438. end if
  1439. end if
  1440. end event
  1441. type tabpage_2 from userobject within tab_2
  1442. integer x = 18
  1443. integer y = 96
  1444. integer width = 2862
  1445. integer height = 836
  1446. long backcolor = 80269524
  1447. string text = "函数"
  1448. long tabtextcolor = 33554432
  1449. long tabbackcolor = 80269524
  1450. long picturemaskcolor = 536870912
  1451. dw_10 dw_10
  1452. dw_9 dw_9
  1453. end type
  1454. on tabpage_2.create
  1455. this.dw_10=create dw_10
  1456. this.dw_9=create dw_9
  1457. this.Control[]={this.dw_10,&
  1458. this.dw_9}
  1459. end on
  1460. on tabpage_2.destroy
  1461. destroy(this.dw_10)
  1462. destroy(this.dw_9)
  1463. end on
  1464. type dw_10 from datawindow within tabpage_2
  1465. integer x = 896
  1466. integer width = 1966
  1467. integer height = 840
  1468. integer taborder = 11
  1469. string title = "none"
  1470. string dataobject = "dw_rpt_column"
  1471. boolean hscrollbar = true
  1472. boolean vscrollbar = true
  1473. boolean livescroll = true
  1474. borderstyle borderstyle = stylelowered!
  1475. end type
  1476. event clicked;if row=0 then return
  1477. if pos('text,column,compute,band,expr,',is_type)>0 then
  1478. if tab_1.tp_1.cbx_1.checked=true then
  1479. is_temp='cname'
  1480. else
  1481. is_temp='ctag'
  1482. end if
  1483. tab_1.tp_1.mle_1.replacetext(getitemstring(row,is_temp))
  1484. tab_1.tp_1.mle_1.setfocus()
  1485. elseif pos('datawindow',is_type)>0 then
  1486. SelectRow(0,False)
  1487. SelectRow(row,true)
  1488. drag(begin!)
  1489. else
  1490. if dwo.name='ograph' then
  1491. i=0
  1492. if xpos>=124 and xpos<=187 and ypos>=115 and ypos<=174 then//2D
  1493. i=1
  1494. elseif xpos>=187 and xpos<=248 and ypos>=115 and ypos<=174 then
  1495. i=2
  1496. elseif xpos>=248 and xpos<=311 and ypos>=115 and ypos<=174 then
  1497. i=7
  1498. elseif xpos>=311 and xpos<=374 and ypos>=115 and ypos<=174 then
  1499. i=12
  1500. elseif xpos>=374 and xpos<=435 and ypos>=115 and ypos<=174 then
  1501. i=13
  1502. elseif xpos>=435 and xpos<=498 and ypos>=115 and ypos<=174 then
  1503. i=14
  1504. elseif xpos>=124 and xpos<=187 and ypos>=196 and ypos<=255 then//3D
  1505. i=15
  1506. elseif xpos>=187 and xpos<=248 and ypos>=196 and ypos<=255 then
  1507. i=3
  1508. elseif xpos>=248 and xpos<=311 and ypos>=196 and ypos<=255 then
  1509. i=8
  1510. elseif xpos>=311 and xpos<=374 and ypos>=196 and ypos<=255 then
  1511. i=16
  1512. elseif xpos>=374 and xpos<=435 and ypos>=196 and ypos<=255 then
  1513. i=17
  1514. elseif xpos>=124 and xpos<=187 and ypos>=280 and ypos<=339 then//stacked
  1515. i=5
  1516. elseif xpos>=187 and xpos<=248 and ypos>=280 and ypos<=339 then
  1517. i=10
  1518. elseif xpos>=248 and xpos<=311 and ypos>=280 and ypos<=339 then//solid
  1519. i=4
  1520. elseif xpos>=311 and xpos<=374 and ypos>=280 and ypos<=339 then
  1521. i=9
  1522. elseif xpos>=374 and xpos<=435 and ypos>=280 and ypos<=339 then//stacked/solid
  1523. i=6
  1524. elseif xpos>=435 and xpos<=498 and ypos>=280 and ypos<=339 then
  1525. i=11
  1526. end if
  1527. wf_graph2(i)
  1528. if i>0 then//统计图类型
  1529. setitem(row,'gtype',string(i))
  1530. end if
  1531. end if
  1532. end if
  1533. end event
  1534. event dragdrop;if pos('datawindow',is_type)>0 then
  1535. DragObject ldo
  1536. DataWindow ldw
  1537. ldo=DraggedObject()
  1538. if TypeOf(ldo)=DataWindow! then
  1539. ldw=ldo
  1540. if ldw.classname()='dw_1' then
  1541. dw1.RowsCopy(dw1.getrow(),dw1.getrow(),primary!,this,this.RowCount()+1,primary!)
  1542. end if
  1543. end if
  1544. end if
  1545. end event
  1546. event itemchanged;if row>0 and pos('graph',is_type)>0 then
  1547. choose case getcolumn()
  1548. case 2
  1549. i=dw_child1.getrow()
  1550. if i>0 then
  1551. setitem(row,'gtfl',dw_child1.getitemstring(i,'ctag'))
  1552. end if
  1553. case 4
  1554. i=dw_child2.getrow()
  1555. if i>0 then
  1556. setitem(row,'gtvalue',dw_child2.getitemstring(i,'ctag'))
  1557. end if
  1558. end choose
  1559. end if
  1560. end event
  1561. event rowfocuschanged;if pos('text,column,compute,band,expr,',is_type)>0 then
  1562. if currentrow>0 and pos('graph',is_type)=0 then
  1563. this.SelectRow(0,False)
  1564. this.SelectRow(currentrow,true)
  1565. end if
  1566. end if
  1567. end event
  1568. type dw_9 from datawindow within tabpage_2
  1569. integer width = 891
  1570. integer height = 840
  1571. integer taborder = 11
  1572. string title = "none"
  1573. string dataobject = "dw_rpt_function"
  1574. boolean hscrollbar = true
  1575. boolean vscrollbar = true
  1576. boolean livescroll = true
  1577. borderstyle borderstyle = stylelowered!
  1578. end type
  1579. event clicked;if row=0 then return
  1580. if pos('text,column,compute,band,expr,',is_type)>0 then
  1581. if tab_1.tp_1.cbx_1.checked=true then
  1582. is_temp='func_english'
  1583. else
  1584. is_temp='func_china'
  1585. end if
  1586. tab_1.tp_1.mle_1.replacetext(getitemstring(row,is_temp))
  1587. tab_1.tp_1.mle_1.SelectText(len(tab_1.tp_1.mle_1.Text),0)
  1588. tab_1.tp_1.mle_1.setfocus()
  1589. elseif pos('datawindow',is_type)>0 then
  1590. SelectRow(0,False)
  1591. SelectRow(row,true)
  1592. drag(begin!)
  1593. end if
  1594. end event
  1595. event dragdrop;if pos('datawindow',is_type)>0 then
  1596. DragObject ldo
  1597. DataWindow ldw
  1598. ldo=DraggedObject()
  1599. if TypeOf(ldo)=DataWindow! then
  1600. ldw=ldo
  1601. if pos('dw_2,dw_3,dw_4',ldw.classname())>0 then
  1602. i=ldw.getrow()
  1603. if i>0 then ldw.deleterow(i)
  1604. end if
  1605. end if
  1606. end if
  1607. end event
  1608. event rowfocuschanged;if pos('text,column,compute,band,expr,',is_type)>0 then
  1609. if currentrow>0 then
  1610. SelectRow(0,False)
  1611. SelectRow(currentrow,true)
  1612. end if
  1613. end if
  1614. end event
  1615. type cbx_1 from checkbox within tp_1
  1616. integer y = 1332
  1617. integer width = 1362
  1618. integer height = 76
  1619. integer textsize = -9
  1620. integer weight = 400
  1621. fontcharset fontcharset = gb2312charset!
  1622. fontpitch fontpitch = variable!
  1623. string facename = "宋体"
  1624. long textcolor = 33554432
  1625. long backcolor = 67108864
  1626. string text = "取英文名称"
  1627. boolean checked = true
  1628. end type
  1629. type st_1 from statictext within tp_1
  1630. integer x = 1563
  1631. integer y = 1436
  1632. integer width = 247
  1633. integer height = 76
  1634. integer textsize = -9
  1635. integer weight = 400
  1636. fontcharset fontcharset = gb2312charset!
  1637. fontpitch fontpitch = variable!
  1638. string facename = "宋体"
  1639. long textcolor = 33554432
  1640. long backcolor = 67108864
  1641. boolean enabled = false
  1642. string text = "st_1"
  1643. boolean focusrectangle = false
  1644. end type
  1645. type dw_4 from datawindow within tp_1
  1646. integer x = 1938
  1647. integer y = 1420
  1648. integer width = 494
  1649. integer height = 96
  1650. string dragicon = "Warning!"
  1651. string dataobject = "dw_rpt_column"
  1652. boolean hscrollbar = true
  1653. boolean vscrollbar = true
  1654. boolean hsplitscroll = true
  1655. boolean livescroll = true
  1656. borderstyle borderstyle = stylelowered!
  1657. end type
  1658. event clicked;if row=0 then return
  1659. if pos('datawindow',is_type)>0 then
  1660. SelectRow(0,False)
  1661. SelectRow(row,true)
  1662. drag(begin!)
  1663. end if
  1664. end event
  1665. event dragdrop;if pos('datawindow',is_type)>0 then
  1666. DragObject ldo
  1667. DataWindow ldw
  1668. ldo=DraggedObject()
  1669. if TypeOf(ldo)=DataWindow! then
  1670. ldw=ldo
  1671. if ldw.classname()='dw_1' then
  1672. dw1.RowsCopy(dw1.getrow(),dw1.getrow(),primary!,this,this.RowCount()+1,primary!)
  1673. i=this.rowcount()
  1674. if i>0 then
  1675. is_temp=this.getitemstring(i,'ctype')
  1676. if pos('decimal,number,long,',left(is_temp,7))>0 then
  1677. is_temp='求和('+this.getitemstring(i,'ctag')+' for crosstab)'
  1678. this.setitem(i,'ctag',is_temp)
  1679. is_temp='sum('+this.getitemstring(i,'cname')+' for crosstab)'
  1680. this.setitem(i,'cname',is_temp)
  1681. else
  1682. is_temp='计数('+this.getitemstring(i,'ctag')+' for crosstab)'
  1683. this.setitem(i,'ctag',is_temp)
  1684. is_temp='count('+this.getitemstring(i,'cname')+' for crosstab)'
  1685. this.setitem(i,'cname',is_temp)
  1686. end if
  1687. end if
  1688. end if
  1689. end if
  1690. end if
  1691. end event
  1692. event doubleclicked;if row=0 then return
  1693. str_rpt lstr
  1694. lstr=istr_rpt
  1695. lstr.tt='expr'
  1696. lstr.t1=f_myget(this,row,'ctag')
  1697. lstr.t2='crossvalue'
  1698. w_rpt_edit w_temp
  1699. openwithparm(w_temp,lstr)
  1700. lstr=message.powerobjectparm
  1701. if isvalid(lstr) then
  1702. setitem(row,'ctag',lstr.t2)//t1
  1703. setitem(row,'cname',lstr.t2)
  1704. setitem(row,'cupdate',lstr.t2)//改为t1时,双击字段后中英翻译有问题.
  1705. end if
  1706. end event
  1707. type cb_5 from commandbutton within tp_1
  1708. integer x = 1038
  1709. integer y = 288
  1710. integer width = 128
  1711. integer height = 76
  1712. integer taborder = 80
  1713. integer textsize = -9
  1714. integer weight = 400
  1715. fontpitch fontpitch = variable!
  1716. string facename = "宋体"
  1717. string text = "或者"
  1718. end type
  1719. event clicked;if cbx_1.checked=true then
  1720. is_temp=' or '
  1721. else
  1722. is_temp=' 或者 '
  1723. end if
  1724. mle_1.replacetext(is_temp)
  1725. mle_1.setfocus()
  1726. end event
  1727. type cb_4 from commandbutton within tp_1
  1728. integer x = 891
  1729. integer y = 288
  1730. integer width = 128
  1731. integer height = 76
  1732. integer taborder = 50
  1733. integer textsize = -9
  1734. integer weight = 400
  1735. fontpitch fontpitch = variable!
  1736. string facename = "宋体"
  1737. string text = "并且"
  1738. end type
  1739. event clicked;if cbx_1.checked=true then
  1740. is_temp=' and '
  1741. else
  1742. is_temp=' 并且 '
  1743. end if
  1744. mle_1.replacetext(is_temp)
  1745. mle_1.setfocus()
  1746. end event
  1747. type cb_3 from commandbutton within tp_1
  1748. integer x = 1339
  1749. integer y = 288
  1750. integer width = 224
  1751. integer height = 76
  1752. integer taborder = 90
  1753. integer textsize = -9
  1754. integer weight = 400
  1755. fontpitch fontpitch = variable!
  1756. string facename = "宋体"
  1757. string text = "校验(&V)"
  1758. end type
  1759. event clicked;is_oexp = tab_1.tp_1.mle_1.Text
  1760. IF wf_verify() = 0 THEN
  1761. MessageBox("提示",'表达式检查正确!'+Char(13)+Char(13)+'翻译成英文表达式为:'+Char(13)+Char(13)+is_o2exp)
  1762. END IF
  1763. end event
  1764. type cb_right from commandbutton within tp_1
  1765. integer x = 745
  1766. integer y = 288
  1767. integer width = 128
  1768. integer height = 76
  1769. integer taborder = 120
  1770. integer textsize = -9
  1771. integer weight = 400
  1772. fontpitch fontpitch = variable!
  1773. string facename = "宋体"
  1774. string text = ")"
  1775. end type
  1776. event clicked;mle_1.replacetext(')')
  1777. mle_1.setfocus()
  1778. end event
  1779. type cb_left from commandbutton within tp_1
  1780. integer x = 599
  1781. integer y = 288
  1782. integer width = 128
  1783. integer height = 76
  1784. integer taborder = 130
  1785. integer textsize = -9
  1786. integer weight = 400
  1787. fontpitch fontpitch = variable!
  1788. string facename = "宋体"
  1789. string text = "("
  1790. end type
  1791. event clicked;mle_1.replacetext('(')
  1792. mle_1.setfocus()
  1793. end event
  1794. type cb_divide from commandbutton within tp_1
  1795. integer x = 453
  1796. integer y = 288
  1797. integer width = 128
  1798. integer height = 76
  1799. integer taborder = 110
  1800. integer textsize = -9
  1801. integer weight = 400
  1802. fontpitch fontpitch = variable!
  1803. string facename = "宋体"
  1804. string text = "/"
  1805. end type
  1806. event clicked;mle_1.replacetext('/')
  1807. mle_1.setfocus()
  1808. end event
  1809. type cb_multiplication from commandbutton within tp_1
  1810. integer x = 302
  1811. integer y = 288
  1812. integer width = 128
  1813. integer height = 76
  1814. integer taborder = 100
  1815. integer textsize = -9
  1816. integer weight = 400
  1817. fontpitch fontpitch = variable!
  1818. string facename = "宋体"
  1819. string text = "*"
  1820. end type
  1821. event clicked;mle_1.replacetext('*')
  1822. mle_1.setfocus()
  1823. end event
  1824. type cb_minus from commandbutton within tp_1
  1825. integer x = 155
  1826. integer y = 288
  1827. integer width = 128
  1828. integer height = 76
  1829. integer taborder = 70
  1830. integer textsize = -9
  1831. integer weight = 400
  1832. fontpitch fontpitch = variable!
  1833. string facename = "宋体"
  1834. string text = "-"
  1835. end type
  1836. event clicked;mle_1.replacetext('-')
  1837. mle_1.setfocus()
  1838. end event
  1839. type cb_plus from commandbutton within tp_1
  1840. integer x = 9
  1841. integer y = 288
  1842. integer width = 128
  1843. integer height = 76
  1844. integer taborder = 30
  1845. integer textsize = -9
  1846. integer weight = 400
  1847. fontpitch fontpitch = variable!
  1848. string facename = "宋体"
  1849. string text = "+"
  1850. end type
  1851. event clicked;mle_1.replacetext('+')
  1852. mle_1.setfocus()
  1853. end event
  1854. type mle_1 from multilineedit within tp_1
  1855. integer y = 4
  1856. integer width = 2898
  1857. integer height = 268
  1858. integer taborder = 10
  1859. boolean bringtotop = true
  1860. integer textsize = -9
  1861. integer weight = 400
  1862. fontpitch fontpitch = variable!
  1863. string facename = "宋体"
  1864. long backcolor = 16777215
  1865. boolean vscrollbar = true
  1866. boolean autovscroll = true
  1867. integer limit = 255
  1868. borderstyle borderstyle = stylelowered!
  1869. end type
  1870. type tp_2 from userobject within tab_1
  1871. integer x = 18
  1872. integer y = 96
  1873. integer width = 2907
  1874. integer height = 1404
  1875. long backcolor = 80269524
  1876. string text = "常用属性"
  1877. long tabtextcolor = 33554432
  1878. long tabbackcolor = 80269524
  1879. long picturemaskcolor = 536870912
  1880. dw_5 dw_5
  1881. end type
  1882. on tp_2.create
  1883. this.dw_5=create dw_5
  1884. this.Control[]={this.dw_5}
  1885. end on
  1886. on tp_2.destroy
  1887. destroy(this.dw_5)
  1888. end on
  1889. type dw_5 from datawindow within tp_2
  1890. integer y = 8
  1891. integer width = 2907
  1892. integer height = 1384
  1893. integer taborder = 1
  1894. string dataobject = "dw_rpt_cysx"
  1895. boolean vscrollbar = true
  1896. boolean livescroll = true
  1897. end type
  1898. event constructor;wf_dw5m7(this)
  1899. end event
  1900. event getfocus;if getrow()=1 then send(handle(this),256,9,0)//此行是在保护名称时有用,不能删除
  1901. end event
  1902. event itemchanged;if is_type='column' and object.data[row,2]='edit.style' then//edit.style,这里的setfilter跟dw8的有些不同
  1903. setfilter("(pos(oproperties,'edit.')+pos(oproperties,'checkbox.')+pos(oproperties,'dddw.')+pos(oproperties,'ddlb.')+pos(oproperties,'editmask.')+pos(oproperties,'radiobuttons.')=0)")
  1904. filter()
  1905. sort()
  1906. elseif is_type='datawindow' and object.data[row,2]='processing' then
  1907. choose case data
  1908. case '1'//grid
  1909. setfilter("osort<=40")
  1910. case '2'//label
  1911. setfilter("osort<=20 or osort>50")
  1912. case '4'//crosstab
  1913. setfilter("osort<=50")
  1914. case else//'0'//freeform
  1915. setfilter("osort<=20")
  1916. end choose
  1917. filter()
  1918. sort()
  1919. end if
  1920. if isvalid(dwo) then
  1921. choose case dwo.name
  1922. case 'o01','o02','o04','o05','o06','o07','o08','o09'
  1923. setitem(row,3,data)
  1924. case 'o03'//1_0
  1925. if object.data[row,2]='background.mode' and data='0' then
  1926. setitem(row,3,'2')//1=透明,2=不透明,但书上写0=不透明,检测为0时如果dw也为透明,则对象什么也看不见
  1927. else
  1928. setitem(row,3,data)
  1929. end if
  1930. end choose
  1931. end if
  1932. end event
  1933. event buttonclicked;IF dwo.Name = 'sort1' THEN
  1934. SetSort('oproperties a')
  1935. Sort()
  1936. Modify("sort1.text='按字母排序▲' sort2.text='按习惯排序'")
  1937. ELSEIF dwo.Name = 'sort2' THEN
  1938. SetSort('osort a')
  1939. Sort()
  1940. Modify("sort1.text='按字母排序' sort2.text='按习惯排序▲'")
  1941. ELSEIF dwo.Name = 'mydddw' THEN
  1942. IF Pos('libexport',is_type) > 0 THEN
  1943. GetFileOpenName("Select File",s[1],s[2],"pbl","Pb Files,*.pbl")
  1944. ELSE
  1945. GetFileOpenName("Select File",s[1],s[2],"pbl","Pb Files,*.pb?")
  1946. END IF
  1947. IF s[1] > '' THEN
  1948. IF Pos('libexport,libimport',is_type) > 0 THEN
  1949. dw7.SetItem(1,3,s[1])
  1950. END IF
  1951. wf_dwchild8(s[1],dw_child9)
  1952. END IF
  1953. END IF
  1954. end event
  1955. event doubleclicked;s[1]=dwo.name
  1956. if pos(',ovalue1,ovalue2,',','+s[1]+',')=0 or row=0 then return
  1957. s[2]=f_myget(this,row,s[1])
  1958. str_rpt lstr
  1959. lstr=istr_rpt
  1960. lstr.tt='expr'
  1961. lstr.t1=s[2]
  1962. lstr.t2='expr'
  1963. w_rpt_edit w_temp
  1964. openwithparm(w_temp,lstr,win_parent)
  1965. lstr=message.powerobjectparm
  1966. if isvalid(lstr) then
  1967. setitem(row,s[1],lstr.t1)
  1968. end if
  1969. end event
  1970. event clicked;if row>0 then
  1971. s[1]=f_myget(this,row,'oproperties')
  1972. if pos(s[1],'color')>0 and dwo.name='ovalue1' then
  1973. s[1]=f_myget(this,row,'ovalue1')
  1974. uo_color.uf_scolor(s[1])
  1975. uo_color.y=PixelsToUnits(ypos,YPixelsToUnits!)+80
  1976. else
  1977. uo_color.visible=false
  1978. end if
  1979. end if
  1980. end event
  1981. type tp_3 from userobject within tab_1
  1982. integer x = 18
  1983. integer y = 96
  1984. integer width = 2907
  1985. integer height = 1404
  1986. long backcolor = 80269524
  1987. string text = "编辑风格"
  1988. long tabtextcolor = 33554432
  1989. long tabbackcolor = 80269524
  1990. long picturemaskcolor = 536870912
  1991. dw_8 dw_8
  1992. dw_7 dw_7
  1993. end type
  1994. on tp_3.create
  1995. this.dw_8=create dw_8
  1996. this.dw_7=create dw_7
  1997. this.Control[]={this.dw_8,&
  1998. this.dw_7}
  1999. end on
  2000. on tp_3.destroy
  2001. destroy(this.dw_8)
  2002. destroy(this.dw_7)
  2003. end on
  2004. type dw_8 from datawindow within tp_3
  2005. integer x = 1906
  2006. integer y = 8
  2007. integer width = 1001
  2008. integer height = 1396
  2009. integer taborder = 11
  2010. string dataobject = "dw_datavalue"
  2011. boolean vscrollbar = true
  2012. boolean livescroll = true
  2013. end type
  2014. event constructor;insertrow(0)
  2015. end event
  2016. type dw_7 from datawindow within tp_3
  2017. integer y = 8
  2018. integer width = 1902
  2019. integer height = 1396
  2020. integer taborder = 11
  2021. string dataobject = "dw_rpt_cysx"
  2022. boolean livescroll = true
  2023. end type
  2024. event constructor;wf_dw5m7(this)
  2025. modify('sort1.visible=false sort2.visible=false')
  2026. end event
  2027. event editchanged;if is_type='column' and object.data[row,2]='dddw.name' then
  2028. wf_dddw(data)
  2029. elseif is_type='column' and object.data[row,2]='edit.codetable' then
  2030. if data='yes' then
  2031. dw8.visible=true
  2032. else
  2033. dw8.visible=false
  2034. end if
  2035. end if
  2036. end event
  2037. event itemchanged;if isvalid(dwo) then
  2038. choose case dwo.name
  2039. case 'o02'
  2040. dw5.setitem(row,3,data)
  2041. if is_type='column' and object.data[row,2]='edit.codetable' then
  2042. if data='yes' then
  2043. goto mydw8
  2044. else
  2045. dw8.visible=false
  2046. end if
  2047. end if
  2048. case 'o01','o02','o03','o04','o05','o06','o07','o08','o09'
  2049. dw5.setitem(row,3,data)
  2050. case 'odddwname'
  2051. if pos('libexport,libimport',is_type)=0 then
  2052. accepttext()
  2053. wf_dddw(data)
  2054. end if
  2055. end choose
  2056. end if
  2057. if is_type='column' and object.data[row,2]='edit.style' then//edit.style
  2058. accepttext()
  2059. dw5.setredraw(false)//不能删除,否则在pb65下会出错
  2060. setredraw(false)
  2061. dw5.setfilter("pos(oproperties,'"+data+".')>0 or oproperties='edit.style'")
  2062. dw5.filter()
  2063. dw5.sort()
  2064. dw5.setredraw(true)
  2065. setredraw(true)
  2066. send(handle(this),256,9,0)//为了显示下拉箭头,原因是ovalue1在底下,而ovalue1.visible=true
  2067. choose case data
  2068. case 'edit'
  2069. wf_sxs1(data+'.case','any',0)
  2070. wf_sxs1(data+'.limit','0',0)
  2071. if wf_sxg1('edit.codetable')='yes' then
  2072. goto mydw8
  2073. else
  2074. dw8.visible=false
  2075. end if
  2076. case 'checkbox'
  2077. dw8.visible=false
  2078. wf_sxs1(data+'.text','',0)
  2079. wf_sxs1(data+'.on','1',0)
  2080. wf_sxs1(data+'.off','0',0)
  2081. wf_sxs1(data+'.threed','yes',0)
  2082. case 'radiobuttons'
  2083. wf_sxs1(data+'.columns','1',0)
  2084. wf_sxs1(data+'.threed','yes',0)
  2085. goto mydw8
  2086. case 'ddlb'
  2087. wf_sxs1(data+'.case','any',0)
  2088. wf_sxs1(data+'.limit','0',0)
  2089. wf_sxs1(data+'.useasborder','yes',0)
  2090. wf_sxs1(data+'.vscrollbar','yes',0)
  2091. goto mydw8
  2092. case 'editmask'
  2093. dw8.visible=false
  2094. wf_sxs1(data+'.mask','###',0)
  2095. wf_sxs1(data+'.spinincr','1',0)
  2096. wf_sxs1(data+'.spin','yes',0)
  2097. case 'dddw'
  2098. dw8.visible=false
  2099. wf_sxs1(data+'.name','',0)
  2100. wf_sxs1(data+'.datacolumn','',0)
  2101. wf_sxs1(data+'.displaycolumn','',0)
  2102. wf_sxs1(data+'.case','any',0)
  2103. wf_sxs1(data+'.limit','0',0)
  2104. wf_sxs1(data+'.lines','0',0)
  2105. wf_sxs1(data+'.percentwidth','100',0)
  2106. wf_sxs1(data+'.useasborder','yes',0)
  2107. wf_sxs1(data+'.vscrollbar','yes',0)
  2108. is_temp=dw7.getitemstring(2,3)//dddw.name
  2109. if dw_child8.rowcount()=0 then
  2110. wf_dwchild8('exportdw.pbd',dw_child8)
  2111. end if
  2112. if is_temp>'' then
  2113. wf_dddw(is_temp)
  2114. end if
  2115. end choose
  2116. end if
  2117. return
  2118. mydw8:
  2119. dw8.visible=true
  2120. s[4]=f_rsx(io[1].others,'id')
  2121. i=long(s[4])
  2122. if i>0 then
  2123. s[3]=win_parent.dw3.getitemstring(i,'cvalues')
  2124. dw8.reset()
  2125. if s[3]='' then
  2126. dw8.insertrow(0)
  2127. return
  2128. end if
  2129. if right(s[3],1)<>'/' then s[3]=s[3]+'/'
  2130. do while true
  2131. i=pos(s[3],char(9))
  2132. if i=0 then exit
  2133. s[1]=left(s[3],i -1)
  2134. s[3]=mid(s[3],i+1)
  2135. i=pos(s[3],'/')
  2136. s[2]=left(s[3],i -1)
  2137. s[3]=mid(s[3],i+1)
  2138. i=dw8.insertrow(0)
  2139. dw8.setitem(i,1,s[1])
  2140. dw8.setitem(i,2,s[2])
  2141. loop
  2142. end if
  2143. end event
  2144. event buttonclicked;IF Pos('libexport',is_type) > 0 THEN
  2145. GetFileOpenName("Select File",s[1],s[2],"pbl","Pb Files,*.pbl")
  2146. ELSE
  2147. GetFileOpenName("Select File",s[1],s[2],"pbl","Pb Files,*.pb?")
  2148. END IF
  2149. IF s[1] > '' THEN
  2150. IF Pos('libexport,libimport',is_type) > 0 THEN
  2151. dw7.SetItem(1,3,s[1])
  2152. END IF
  2153. wf_dwchild8(s[1],dw_child8)
  2154. END IF
  2155. end event
  2156. type cb_2 from commandbutton within w_rpt_edit
  2157. integer x = 1385
  2158. integer y = 1528
  2159. integer width = 274
  2160. integer height = 100
  2161. integer taborder = 30
  2162. integer textsize = -9
  2163. integer weight = 400
  2164. fontpitch fontpitch = variable!
  2165. string facename = "宋体"
  2166. string text = "取消(&N)"
  2167. boolean cancel = true
  2168. end type
  2169. event clicked;close(parent)
  2170. end event
  2171. type cb_1 from commandbutton within w_rpt_edit
  2172. integer x = 777
  2173. integer y = 1528
  2174. integer width = 274
  2175. integer height = 100
  2176. integer taborder = 20
  2177. integer textsize = -9
  2178. integer weight = 400
  2179. fontpitch fontpitch = variable!
  2180. string facename = "宋体"
  2181. string pointer = "Icon!"
  2182. string text = "确认(&Y)"
  2183. boolean default = true
  2184. end type
  2185. event clicked;dw5.accepttext()
  2186. dw7.accepttext()
  2187. dw8.accepttext()
  2188. dw5.setfilter('')//column中有setfilter()
  2189. dw5.filter()
  2190. dw5.setsort('osort a')
  2191. dw5.sort()
  2192. if istr_rpt.tt='crosstab' then
  2193. if wf_crosstabw()=1 then
  2194. goto myerror
  2195. end if
  2196. end if
  2197. if pos("libexport,libimport,datawindow,",is_type)=0 then
  2198. if wf_verify()=1 then goto myerror
  2199. if pos('expr,',is_type)=0 then
  2200. if wf_name()=1 then goto myerror//检查对象名是否有效
  2201. end if
  2202. end if
  2203. if wf_sxg0()=1 then goto myerror//读取常用属性到win_parent.io[iio]
  2204. if is_type='libexport' then
  2205. if isvalid(win_parent.idwm) then
  2206. int li_rows
  2207. li_rows=win_parent.idwm.rowcount()
  2208. for i=1 to li_rows//检查另存dw有无重名
  2209. if i<>win_parent.ii_rowm and io[1].oname=f_myget(win_parent.idwm,i,'rdname') then
  2210. messagebox('提示信息',f_myget(win_parent.idwm,i,'rid')+'['+f_myget(win_parent.idwm,i,'rcname')+']已使用<'+io[1].oname+'>名字,请改名!')
  2211. goto myerror
  2212. end if
  2213. next
  2214. win_parent.idwm.setitem(win_parent.ii_rowm,'rdname',io[1].oname)
  2215. end if
  2216. s[1]=win_parent.is_dw
  2217. if io[1].oname>'' and LibraryImport(io[1].otype,io[1].oname,ImportDataWindow!,s[1],s[2],win_parent.istr_rpt.rcname)=1 then//io[1].oname=dw_name,s[1]=dw_Syntax,s[2]=errors
  2218. messagebox('提示信息','另存为'+io[1].oname+'成功!')
  2219. else
  2220. messagebox('出错信息',io[1].oname+'存档失败!',stopsign!)
  2221. end if
  2222. elseif is_type='libimport' then
  2223. elseif is_type='expr' then
  2224. istr_rpt.t1=is_oexp
  2225. istr_rpt.t2=is_o2exp
  2226. else
  2227. wf_modify()//设置新的属性
  2228. end if
  2229. closewithreturn(parent,istr_rpt)
  2230. return
  2231. myerror:
  2232. tab_1.event selectionchanging(1,tab_1.SelectedTab)//恢复dw5.setfilter
  2233. return
  2234. end event
  2235. type cb_20 from commandbutton within w_rpt_edit
  2236. event clicked pbm_bnclicked
  2237. integer x = 1952
  2238. integer y = 1528
  2239. integer width = 274
  2240. integer height = 100
  2241. integer taborder = 50
  2242. integer textsize = -9
  2243. integer weight = 400
  2244. fontpitch fontpitch = variable!
  2245. string facename = "宋体"
  2246. string text = "帮助(&H)"
  2247. end type
  2248. event clicked;ShowHelp("report.HLP", keyword!, "report_edit")
  2249. end event