w_rpt_sql.srw 51 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213
  1. $PBExportHeader$w_rpt_sql.srw
  2. $PBExportComments$设置数据源--窗口
  3. forward
  4. global type w_rpt_sql from w_rpt_base
  5. end type
  6. type tab_1 from tab within w_rpt_sql
  7. end type
  8. type tp_table from userobject within tab_1
  9. end type
  10. type dw_1 from datawindow within tp_table
  11. end type
  12. type tp_table from userobject within tab_1
  13. dw_1 dw_1
  14. end type
  15. type tp_where from userobject within tab_1
  16. end type
  17. type dw_2 from datawindow within tp_where
  18. end type
  19. type dw_5 from datawindow within tp_where
  20. end type
  21. type tp_where from userobject within tab_1
  22. dw_2 dw_2
  23. dw_5 dw_5
  24. end type
  25. type tp_col from userobject within tab_1
  26. end type
  27. type dw_3 from datawindow within tp_col
  28. end type
  29. type cb_2 from commandbutton within tp_col
  30. end type
  31. type cb_3 from commandbutton within tp_col
  32. end type
  33. type tp_col from userobject within tab_1
  34. dw_3 dw_3
  35. cb_2 cb_2
  36. cb_3 cb_3
  37. end type
  38. type tp_sort from userobject within tab_1
  39. end type
  40. type dw_4 from datawindow within tp_sort
  41. end type
  42. type tp_sort from userobject within tab_1
  43. dw_4 dw_4
  44. end type
  45. type tp_sql from userobject within tab_1
  46. end type
  47. type mle_1 from multilineedit within tp_sql
  48. end type
  49. type dw_10 from datawindow within tp_sql
  50. end type
  51. type tp_sql from userobject within tab_1
  52. mle_1 mle_1
  53. dw_10 dw_10
  54. end type
  55. type tp_procedure from userobject within tab_1
  56. end type
  57. type dw_6 from datawindow within tp_procedure
  58. end type
  59. type sle_1 from singlelineedit within tp_procedure
  60. end type
  61. type st_1 from statictext within tp_procedure
  62. end type
  63. type st_2 from statictext within tp_procedure
  64. end type
  65. type tp_procedure from userobject within tab_1
  66. dw_6 dw_6
  67. sle_1 sle_1
  68. st_1 st_1
  69. st_2 st_2
  70. end type
  71. type tp_wbsjy from userobject within tab_1
  72. end type
  73. type dw_7 from datawindow within tp_wbsjy
  74. end type
  75. type tp_wbsjy from userobject within tab_1
  76. dw_7 dw_7
  77. end type
  78. type tp_bbgs from userobject within tab_1
  79. end type
  80. type gb_3 from groupbox within tp_bbgs
  81. end type
  82. type gb_2 from groupbox within tp_bbgs
  83. end type
  84. type gb_1 from groupbox within tp_bbgs
  85. end type
  86. type rb_1 from radiobutton within tp_bbgs
  87. end type
  88. type rb_2 from radiobutton within tp_bbgs
  89. end type
  90. type rb_3 from radiobutton within tp_bbgs
  91. end type
  92. type ddlb_1 from dropdownlistbox within tp_bbgs
  93. end type
  94. type dw_8 from datawindow within tp_bbgs
  95. end type
  96. type ddlb_3 from dropdownlistbox within tp_bbgs
  97. end type
  98. type dw_9 from datawindow within tp_bbgs
  99. end type
  100. type ddlb_2 from dropdownlistbox within tp_bbgs
  101. end type
  102. type ddlb_4 from dropdownlistbox within tp_bbgs
  103. end type
  104. type rb_6 from radiobutton within tp_bbgs
  105. end type
  106. type rb_5 from radiobutton within tp_bbgs
  107. end type
  108. type rb_7 from radiobutton within tp_bbgs
  109. end type
  110. type rb_9 from radiobutton within tp_bbgs
  111. end type
  112. type rb_4 from radiobutton within tp_bbgs
  113. end type
  114. type rb_8 from radiobutton within tp_bbgs
  115. end type
  116. type rb_10 from radiobutton within tp_bbgs
  117. end type
  118. type em_1 from editmask within tp_bbgs
  119. end type
  120. type st_3 from statictext within tp_bbgs
  121. end type
  122. type tp_bbgs from userobject within tab_1
  123. gb_3 gb_3
  124. gb_2 gb_2
  125. gb_1 gb_1
  126. rb_1 rb_1
  127. rb_2 rb_2
  128. rb_3 rb_3
  129. ddlb_1 ddlb_1
  130. dw_8 dw_8
  131. ddlb_3 ddlb_3
  132. dw_9 dw_9
  133. ddlb_2 ddlb_2
  134. ddlb_4 ddlb_4
  135. rb_6 rb_6
  136. rb_5 rb_5
  137. rb_7 rb_7
  138. rb_9 rb_9
  139. rb_4 rb_4
  140. rb_8 rb_8
  141. rb_10 rb_10
  142. em_1 em_1
  143. st_3 st_3
  144. end type
  145. type tab_1 from tab within w_rpt_sql
  146. tp_table tp_table
  147. tp_where tp_where
  148. tp_col tp_col
  149. tp_sort tp_sort
  150. tp_sql tp_sql
  151. tp_procedure tp_procedure
  152. tp_wbsjy tp_wbsjy
  153. tp_bbgs tp_bbgs
  154. end type
  155. type dw11 from datawindow within w_rpt_sql
  156. end type
  157. type rb_s1 from radiobutton within w_rpt_sql
  158. end type
  159. type rb_s2 from radiobutton within w_rpt_sql
  160. end type
  161. type rb_s3 from radiobutton within w_rpt_sql
  162. end type
  163. type rb_s4 from radiobutton within w_rpt_sql
  164. end type
  165. type cb_yes from commandbutton within w_rpt_sql
  166. end type
  167. type cb_no from commandbutton within w_rpt_sql
  168. end type
  169. end forward
  170. global type w_rpt_sql from w_rpt_base
  171. integer y = 4
  172. integer width = 3282
  173. integer height = 1816
  174. string title = "自动生成数据窗口向导"
  175. boolean minbox = false
  176. boolean maxbox = false
  177. boolean resizable = false
  178. windowtype windowtype = response!
  179. windowstate windowstate = normal!
  180. long backcolor = 80269524
  181. tab_1 tab_1
  182. dw11 dw11
  183. rb_s1 rb_s1
  184. rb_s2 rb_s2
  185. rb_s3 rb_s3
  186. rb_s4 rb_s4
  187. cb_yes cb_yes
  188. cb_no cb_no
  189. end type
  190. global w_rpt_sql w_rpt_sql
  191. type variables
  192. datawindow dw01,dw02,dw03,dw04,dw05,dw06,dw07,dw10
  193. DataWindowChild dw_child1,dw_child2,dw_child3
  194. string is_ctag
  195. int ii_bbgs=1,ii_band_size,ii_tables,ii_select_count,ii_select_row
  196. datastore ids,ids2
  197. int ii_rowc=50,ii_sqlno=1
  198. string is_sqlselect,is_where,is_fields,is_from,is_sort,is_group,is_from_old,is_arguments
  199. string is_procedure
  200. w_rpt_main win_parent
  201. end variables
  202. forward prototypes
  203. public subroutine wf_select (datawindow f_dw, integer f_row, integer f_label)
  204. public subroutine wf_dwclick (datawindow f_dw, integer f_row)
  205. public subroutine wf_button (datawindow f_dw, integer f_label)
  206. public subroutine wf_sql ()
  207. public subroutine wf_getfrom ()
  208. public subroutine wf_bbgs (string s_bbgs)
  209. public subroutine wf_arg ()
  210. public function integer wf_dw11 (string ssql)
  211. end prototypes
  212. public subroutine wf_select (datawindow f_dw, integer f_row, integer f_label);int li_row,li_select_row,j
  213. string ls_select_row
  214. if f_label= -1 then
  215. ii_select_count=ii_select_count -1
  216. is_ctag=f_dw.getitemstring(f_row,'ctag')
  217. ii_select_row=long(left(is_ctag,3))
  218. is_ctag=right(is_ctag,len(is_ctag) -4)
  219. f_dw.setitem(f_row,'ctag',is_ctag)
  220. for j=1 to 999
  221. li_row=f_dw.getSelectedRow(li_row)
  222. if li_row=0 then exit
  223. is_ctag=f_dw.getitemstring(li_row,'ctag')
  224. li_select_row=long(left(is_ctag,3))
  225. ls_select_row=string(li_select_row -1)
  226. ls_select_row=space(3 -len(ls_select_row))+ls_select_row
  227. if li_select_row>ii_select_row then
  228. is_ctag=ls_select_row+'.'+right(is_ctag,len(is_ctag) -4)
  229. f_dw.setitem(li_row,'ctag',is_ctag)
  230. end if
  231. next
  232. else
  233. ii_select_count=ii_select_count+1
  234. is_ctag=string(ii_select_count)
  235. is_ctag=space(3 -len(is_ctag))+is_ctag
  236. is_ctag=is_ctag+'.'+f_dw.getitemstring(f_row,'ctag')
  237. f_dw.setitem(f_row,'ctag',is_ctag)
  238. end if
  239. return
  240. end subroutine
  241. public subroutine wf_dwclick (datawindow f_dw, integer f_row);if f_row>0 then
  242. if f_dw.getSelectedrow(f_row -1)=f_row then
  243. f_dw.Selectrow(f_row,false)
  244. wf_select(f_dw,f_row,-1)
  245. else
  246. f_dw.Selectrow(f_row,true)
  247. wf_select(f_dw,f_row,1)
  248. end if
  249. end if
  250. end subroutine
  251. public subroutine wf_button (datawindow f_dw, integer f_label);int li,li_rows
  252. li_rows=f_dw.rowcount()
  253. for li=1 to li_rows
  254. if f_dw.getSelectedRow(li -1)=li then
  255. if f_label=-1 then
  256. f_dw.SelectRow(li,false)
  257. wf_select(f_dw,li,-1)
  258. end if
  259. else
  260. if f_label=1 then
  261. f_dw.SelectRow(li,true)
  262. wf_select(f_dw,li,1)
  263. end if
  264. end if
  265. next
  266. end subroutine
  267. public subroutine wf_sql ();string ls_fields,ls_dbname,ls_name,ls_tag,ls_type,ls_table
  268. int j,li_row,li_len2,li_pos
  269. ids.reset()
  270. dw11.reset()
  271. dw02.accepttext()
  272. dw04.accepttext()
  273. ii_rows=dw03.rowcount()
  274. dw03.rowscopy(1,ii_rows,Primary!,ids,1,Primary!)
  275. ids.setfilter("mid(ctag,4,1)='.'")
  276. ids.filter()//过滤选择好的字段
  277. ids.setsort("ctag")
  278. ids.sort()//按选择字段的顺序排序
  279. if is_datasource='dw' then//前台
  280. is_sqlselect=f_replace(trim(ids2.object.datawindow.table.sqlselect),'~~~"','')//SQL语句里的~"可以去掉
  281. else//后台
  282. wf_getfrom()
  283. end if
  284. ii_rows=ids.rowcount()
  285. for i=1 to ii_rows
  286. ls_dbname=ids.getitemstring(i,2)
  287. ls_fields=ls_fields+','+ls_dbname
  288. if is_datasource='dw' then//前台
  289. ls_tag=mid(ids.getitemstring(i,1),5)
  290. ls_type=ids.getitemstring(i,3)
  291. ls_name=ids.getitemstring(i,4)
  292. ls_tag=mid(ls_tag,pos(ls_tag,'.')+1)
  293. li_pos=pos(ls_dbname,'.')
  294. ls_table=left(ls_dbname,li_pos -1)
  295. ii_row=dw11.insertrow(0)
  296. dw11.setitem(ii_row,'cname',ls_name)
  297. dw11.setitem(ii_row,'cdbname',ls_dbname)
  298. dw11.setitem(ii_row,'ctag',ls_tag)
  299. dw11.setitem(ii_row,'ctype',ls_type)
  300. dw11.setitem(ii_row,'cinitial',ids.getitemstring(i,'cinitial'))
  301. if pos(is_from,',')=0 then
  302. dw11.setitem(ii_row,'cupdate','yes')
  303. dw11.setitem(ii_row,'ckey',ids.getitemstring(i,'ckey'))
  304. end if
  305. end if
  306. next
  307. if is_datasource<>'dw' then//后台
  308. is_where=''
  309. ii_row=dw02.rowcount()
  310. for i=1 to ii_row//通过关联字段生成where子句语法
  311. s[1]=dw02.getitemstring(i,'s_col1')
  312. s[2]=dw02.getitemstring(i,'s_col2')
  313. s[5]=dw02.getitemstring(i,'s_zkh')
  314. s[6]=dw02.getitemstring(i,'s_ykh')
  315. if s[1]>'' and s[2]>'' then
  316. s[3]=' '+dw02.getitemstring(i,'s_relation')+' '
  317. if i=1 then
  318. s[4]=''
  319. else
  320. s[4]=dw02.getitemstring(i -1,'s_label')
  321. end if
  322. if s[4]='' then s[4]=' and '
  323. if is_where>'' then
  324. is_where=is_where+s[4]+s[5]+s[1]+s[3]+s[2]+s[6]
  325. else
  326. is_where=s[5]+s[1]+s[3]+s[2]+s[6]
  327. end if
  328. end if
  329. next
  330. is_sort=''
  331. for j=1 to ii_rowc//提取排序表达式
  332. s[1]=trim(dw04.getitemstring(j,1))
  333. s[2]=dw04.getitemstring(j,2)
  334. if s[1]>'' then
  335. if s[2]='2' then
  336. s[1]=s[1]+' desc'
  337. else
  338. s[1]=s[1]+' asc'
  339. end if
  340. is_sort=is_sort+','+s[1]
  341. end if
  342. next
  343. is_sort=mid(is_sort,2)
  344. ls_fields=mid(ls_fields,2)
  345. is_sqlselect='select '+ls_fields+' from '+is_from
  346. if is_where>'' then is_sqlselect=is_sqlselect+' where '+is_where
  347. if is_group>'' then is_sqlselect=is_sqlselect+' group by '+is_group
  348. if is_sort>'' then is_sqlselect=is_sqlselect+' order by '+is_sort
  349. end if
  350. //messagebox('',is_sqlselect)
  351. return
  352. end subroutine
  353. public subroutine wf_getfrom ();int li
  354. ii_tables=0
  355. is_from=''
  356. ii_rows=dw01.rowcount()
  357. for i=1 to ii_rows
  358. li=dw01.getSelectedRow(li)
  359. if li=0 then exit
  360. ii_tables++
  361. is_from=is_from+','+dw01.getitemstring(li,'table_english')
  362. next
  363. is_from=mid(is_from,2)
  364. end subroutine
  365. public subroutine wf_bbgs (string s_bbgs);ii_bbgs=long(left(s_bbgs,2))
  366. if ii_bbgs=0 then
  367. ii_bbgs=long(win_parent.id[1].ox1)
  368. if ii_bbgs>0 then
  369. ii_bbgs=ii_bbgs+5
  370. else
  371. is_temp=win_parent.id[1].ofweight
  372. if long(is_temp)>1 then
  373. ii_bbgs=5
  374. tab_1.tp_bbgs.em_1.text=is_temp
  375. else
  376. ii_bbgs=1
  377. end if
  378. end if
  379. choose case ii_bbgs
  380. case 1
  381. tab_1.tp_bbgs.rb_1.postevent(clicked!)
  382. case 5
  383. tab_1.tp_bbgs.rb_5.postevent(clicked!)
  384. case 6
  385. tab_1.tp_bbgs.rb_6.postevent(clicked!)
  386. case 7
  387. tab_1.tp_bbgs.rb_7.postevent(clicked!)
  388. case 8
  389. tab_1.tp_bbgs.rb_8.postevent(clicked!)
  390. case 9
  391. tab_1.tp_bbgs.rb_9.postevent(clicked!)
  392. case 10
  393. tab_1.tp_bbgs.rb_10.postevent(clicked!)
  394. end choose
  395. elseif ii_bbgs=5 then
  396. tab_1.tp_bbgs.st_3.visible=true
  397. tab_1.tp_bbgs.em_1.visible=true
  398. else
  399. tab_1.tp_bbgs.st_3.visible=false
  400. tab_1.tp_bbgs.em_1.visible=false
  401. end if
  402. end subroutine
  403. public subroutine wf_arg ();is_arguments=''
  404. ii_rows=dw05.rowcount()
  405. for i=1 to ii_rows//提取参数
  406. s[1]=trim(dw05.getitemstring(i,1))
  407. s[2]=trim(dw05.getitemstring(i,2))
  408. if s[1]>'' then
  409. if is_arguments>'' then is_arguments=is_arguments+','
  410. is_arguments=is_arguments+'("'+s[1]+'",'+s[2]+')'
  411. end if
  412. next
  413. if is_arguments>'' then is_arguments='('+is_arguments+')'
  414. end subroutine
  415. public function integer wf_dw11 (string ssql);ii_rows=dw05.rowcount()
  416. for i=1 to ii_rows//提取参数
  417. s[3]=trim(dw05.getitemstring(i,1))
  418. if s[3]='' then continue
  419. s[4]=trim(dw05.getitemstring(i,2))
  420. choose case s[4]
  421. case 'date'
  422. s[5]=string(today())
  423. ssql=f_replace(ssql,':'+s[3],"'"+s[5]+"'")
  424. case 'datetime'
  425. s[5]=string(now())
  426. ssql=f_replace(ssql,':'+s[3],"'"+s[5]+"'")
  427. case 'time'
  428. s[5]=string(time(now()))
  429. case 'string','number','numberlist'
  430. s[5]='0'
  431. ssql=f_replace(ssql,':'+s[3],s[5])
  432. case else
  433. s[5]='0'
  434. ssql=f_replace(ssql,':'+s[3],s[5])
  435. end choose
  436. next
  437. dw11.reset()
  438. s[6]=f_rpt_gdw(ssql,dw11,it_report,'','')
  439. if s[6]>'' then
  440. messagebox('出错信息',s[6])
  441. return 1
  442. end if
  443. istr_rpt.rsql2=ssql//此SQL的参数已经有值,可以直接运行
  444. return 0
  445. end function
  446. on w_rpt_sql.create
  447. int iCurrent
  448. call super::create
  449. this.tab_1=create tab_1
  450. this.dw11=create dw11
  451. this.rb_s1=create rb_s1
  452. this.rb_s2=create rb_s2
  453. this.rb_s3=create rb_s3
  454. this.rb_s4=create rb_s4
  455. this.cb_yes=create cb_yes
  456. this.cb_no=create cb_no
  457. iCurrent=UpperBound(this.Control)
  458. this.Control[iCurrent+1]=this.tab_1
  459. this.Control[iCurrent+2]=this.dw11
  460. this.Control[iCurrent+3]=this.rb_s1
  461. this.Control[iCurrent+4]=this.rb_s2
  462. this.Control[iCurrent+5]=this.rb_s3
  463. this.Control[iCurrent+6]=this.rb_s4
  464. this.Control[iCurrent+7]=this.cb_yes
  465. this.Control[iCurrent+8]=this.cb_no
  466. end on
  467. on w_rpt_sql.destroy
  468. call super::destroy
  469. destroy(this.tab_1)
  470. destroy(this.dw11)
  471. destroy(this.rb_s1)
  472. destroy(this.rb_s2)
  473. destroy(this.rb_s3)
  474. destroy(this.rb_s4)
  475. destroy(this.cb_yes)
  476. destroy(this.cb_no)
  477. end on
  478. event open;call super::open;win_parent = this.parentwindow()
  479. f_wcenter(this)
  480. //定义dw01,dw02,dw03,dw04是为了之后编程书写方便
  481. dw01=tab_1.tp_table.dw_1
  482. dw02=tab_1.tp_where.dw_2
  483. dw03=tab_1.tp_col.dw_3
  484. dw04=tab_1.tp_sort.dw_4
  485. dw05=tab_1.tp_where.dw_5
  486. dw06=tab_1.tp_procedure.dw_6
  487. dw07=tab_1.tp_wbsjy.dw_7
  488. dw10=tab_1.tp_sql.dw_10
  489. //ctag是选择的字段前面加了编号,ctag2则是没有加编号的字段中文名
  490. dw03.modify("ctag.visible=1 ctag2.visible=0")
  491. it_report=istr_rpt.transation//接收参数
  492. is_datasource=istr_rpt.datasource
  493. ids=create datastore
  494. ids.dataobject=dw03.dataobject
  495. ids2=create datastore
  496. if is_datasource='dw' then
  497. tab_1.tp_table.visible=false
  498. tab_1.tp_where.visible=false
  499. tab_1.tp_sort.visible=false
  500. istr_rpt.isdw=istr_rpt.userdw.object.datawindow.syntax
  501. ids2.create(istr_rpt.isdw)
  502. ids2.settransobject(it_report)
  503. else
  504. dw01.SETTRANSOBJECT(it_report)
  505. dw01.retrieve()
  506. for i=1 to ii_rowc
  507. dw02.insertrow(0)
  508. dw04.insertrow(0)
  509. next
  510. dw02.GetChild('s_col1',dw_child1)
  511. dw02.GetChild('s_col2',dw_child2)
  512. dw04.GetChild('s_sort',dw_child3)
  513. dw03.sharedata(dw_child1)
  514. dw03.sharedata(dw_child2)
  515. dw03.sharedata(dw_child3)
  516. end if
  517. tab_1.tp_bbgs.dw_8.INSERTROW(0)
  518. tab_1.tp_bbgs.dw_9.INSERTROW(0)
  519. tab_1.tp_bbgs.dw_8.modify("text_1.text='标题字体示例' text_1.font.height='24'")
  520. tab_1.tp_bbgs.dw_9.modify("text_1.text='内容字体示例' text_1.font.height='12'")
  521. if istr_rpt.auto='sql' then//重新设置数据源
  522. tab_1.tp_bbgs.visible=false
  523. title='重新设置数据源'
  524. end if
  525. wf_bbgs('0')
  526. is_arguments=istr_rpt.rarguments
  527. is_sqlselect=istr_rpt.rsqlselect
  528. is_procedure=istr_rpt.rprocedure
  529. if is_sqlselect='' and is_procedure='' and win_parent.dw3.rowcount()>0 then
  530. ii_sqlno=3
  531. elseif is_sqlselect='' and is_procedure>'' then
  532. ii_sqlno=4
  533. else
  534. if pos(is_sqlselect,'~n')>0 then//SQL中有回车符,则认为是直接写SQL语句
  535. ii_sqlno=2
  536. else
  537. ii_sqlno=1
  538. end if
  539. end if
  540. f_rpt_cksql(is_sqlselect,is_fields,is_from,is_where,is_group,is_sort)
  541. /////////////修改点////////////--------is_where
  542. if istr_rpt.auto <> 'sql' then
  543. is_where = istr_rpt.wheresql
  544. is_from = istr_rpt.tablename
  545. end if
  546. if ii_sqlno=1 then
  547. is_from=is_from+','
  548. is_where=is_where+' and '
  549. is_sort=is_sort+','
  550. do while 1=1//重新标记已选的表
  551. l[1]=pos(is_from,',')
  552. if l[1]<2 then exit
  553. s[1]=trim(left(is_from,l[1] -1))
  554. is_from=mid(is_from,l[1]+1)
  555. ii_row=dw01.Find("table_english='"+s[1]+"'",1,999)
  556. if ii_row>0 then
  557. dw01.SelectRow(ii_row,TRUE)
  558. else
  559. ii_sqlno=2
  560. end if
  561. loop
  562. tab_1.event selectionchanged(1,3)//去取dw03的数据
  563. if is_where<>' and ' then
  564. string ls[]
  565. int j,k,m
  566. is_temp=dw02.describe('s_relation.values')
  567. is_temp=f_replace(is_temp,'/','~t')
  568. f_atab(ls[],is_temp)
  569. k=upperbound(ls[])
  570. for i=1 to ii_rowc
  571. l[1]=pos(is_where,' and ')
  572. l[2]=pos(is_where,' or ')
  573. if l[1]+l[2]=0 then exit
  574. if l[1]>0 and l[2]>0 then
  575. l[3]=min(l[1],l[2])
  576. elseif l[1]>0 then
  577. l[3]=l[1]
  578. else
  579. l[3]=l[2]
  580. end if
  581. s[3]=trim(left(is_where,l[3] -1))
  582. is_where=lefttrim(mid(is_where,l[3]+4))//lefttrim不能改为trim,因为最后是' and '
  583. if is_where>'' then
  584. if l[1]=l[3] then
  585. dw02.setitem(i,'s_label',' and ')
  586. else
  587. dw02.setitem(i,'s_label',' or ')
  588. end if
  589. end if
  590. if s[3]>'' then
  591. for j=k to 1 step -1
  592. l[1]=pos(s[3],ls[j])
  593. if l[1]>0 then
  594. if pos(ls[j],'=')+pos(ls[j],'>')+pos(ls[j],'<')=0 then
  595. if l[1]=1 or pos(' '+char(9),mid(s[3],l[1] -1,1))=0 or pos(' '+char(9),mid(s[3],l[1]+len(ls[j]),1))=0 then//比较符为英文单词时,前面一个字符必须为空格或Tab字符
  596. continue
  597. end if
  598. end if
  599. s[1]=trim(left(s[3],l[1] -1))
  600. s[2]=trim(mid(s[3],l[1]+len(ls[j])))
  601. s[3]=''
  602. s[4]=''
  603. for m=1 to 6
  604. if left(s[1],1)='(' then
  605. s[3]=s[3]+'('
  606. s[1]=trim(mid(s[1],2))
  607. else
  608. exit
  609. end if
  610. next
  611. for m=1 to 6
  612. if right(s[2],1)=')' then
  613. s[4]=s[4]+')'
  614. s[2]=trim(left(s[2],len(s[2])-1))
  615. else
  616. exit
  617. end if
  618. next
  619. dw02.setitem(i,'s_col1',s[1])
  620. dw02.setitem(i,'s_col2',s[2])
  621. dw02.setitem(i,'s_relation',ls[j])
  622. dw02.setitem(i,'s_zkh',s[3])
  623. dw02.setitem(i,'s_ykh',s[4])
  624. exit
  625. end if
  626. next
  627. if j=0 then
  628. ii_sqlno=2
  629. end if
  630. end if
  631. next
  632. end if
  633. l[2]=1//重新标记已选的索引
  634. for i=1 to ii_rowc//is_sort=表达式1 asc,表达式2 desc,索引字段也带表名
  635. l[1]=pos(is_sort,',',l[2])
  636. if l[1]=0 then exit
  637. s[2]='1'
  638. s[3]=trim(left(is_sort,l[1] -1))
  639. if right(lower(s[3]),5)=' desc' then
  640. s[1]=trim(left(s[3],l[1] -6))
  641. s[2]='2'
  642. elseif right(lower(s[3]),4)=' asc' then
  643. s[1]=trim(left(s[3],l[1] -5))
  644. elseif pos(s[3],'(',l[2])=0 then//没有函数情况
  645. s[1]=s[3]
  646. elseif pos(s[3],'(',l[2])>0 then//暂时只能处理只有一个函数有','的情况,否则此索引会变成两个
  647. l[2]=l[1]+1
  648. i --
  649. continue
  650. end if
  651. dw04.setitem(i,1,s[1])
  652. if s[2]='2' then dw04.setitem(i,2,'2')
  653. is_sort=trim(mid(is_sort,l[1]+1))
  654. l[2]=1
  655. next
  656. end if
  657. is_arguments=mid(is_arguments,2,len(is_arguments)-2)//把两边的括号去掉
  658. /////////////修改点////////////--------is_arguments
  659. if istr_rpt.auto <> 'sql' then
  660. is_arguments=istr_rpt.arguments
  661. end if
  662. do while 1=1//重新标记参数
  663. l[1]=pos(is_arguments,'(')
  664. l[2]=pos(is_arguments,',',l[1])
  665. l[3]=pos(is_arguments,')',l[1])
  666. if l[1]<1 then exit
  667. s[1]=trim(mid(is_arguments,l[1]+2,l[2] -l[1] -3))
  668. s[2]=trim(mid(is_arguments,l[2]+1,l[3] -l[2] -1))
  669. is_arguments=mid(is_arguments,l[3]+1)
  670. i=dw05.insertrow(0)
  671. dw05.setitem(i,1,s[1])
  672. dw05.setitem(i,2,s[2])
  673. loop
  674. dw05.sharedata(dw06)
  675. dw05.sharedata(dw10)
  676. if ii_bbgs=9 then//crosstab
  677. wf_dw11(istr_rpt.rsqlselect+istr_rpt.rprocedure)//
  678. else
  679. win_parent.dw3.sharedata(dw11)
  680. end if
  681. ii_rows=dw11.rowcount()
  682. for i=1 to ii_rows
  683. if ii_sqlno=3 then//外部数据源
  684. s[1]=dw11.getitemstring(i,'cname')
  685. s[2]=dw11.getitemstring(i,'ctype')
  686. dw07.insertrow(0)
  687. dw07.setitem(i,1,s[1])
  688. if pos(s[2],'decimal')=1 then
  689. dw07.setitem(i,2,'decimal')
  690. dw07.setitem(i,4,long(mid(s[2],9,len(s[2])-9)))
  691. elseif pos(s[2],'char')=1 then
  692. dw07.setitem(i,2,'string')
  693. dw07.setitem(i,3,long(mid(s[2],6,len(s[2])-6)))
  694. elseif pos(s[2],'varchar')=1 then
  695. dw07.setitem(i,2,'string')
  696. dw07.setitem(i,3,long(mid(s[2],9,len(s[2])-9)))
  697. else
  698. dw07.setitem(i,2,s[2])
  699. end if
  700. elseif ii_sqlno<3 then//存储过程跳过
  701. s[1]=dw11.getitemstring(i,'cdbname')
  702. l[2]=dw03.find("cdbname='"+s[1]+"'",1,999)
  703. if l[2]>0 then
  704. wf_dwclick(dw03,l[2])
  705. else
  706. ii_sqlno=2
  707. end if
  708. end if
  709. next
  710. if ii_bbgs<>9 then//非crosstab
  711. win_parent.dw3.sharedataoff()
  712. end if
  713. if is_procedure>'' then
  714. l[1]=pos(is_procedure,'execute ')
  715. l[2]=pos(is_procedure,';')
  716. if l[2]=0 then l[2]=pos(is_procedure,' ',l[1]+8)
  717. if l[1]>0 and l[2]>0 then
  718. s[1]=trim(mid(is_procedure,l[1]+8,l[2] -l[1] -8))
  719. tab_1.tp_procedure.sle_1.text=s[1]
  720. end if
  721. end if
  722. if is_datasource='dw' then
  723. choose case ii_sqlno
  724. case 1
  725. rb_s1.checked=true
  726. case 2
  727. rb_s2.checked=true
  728. case 3
  729. rb_s3.checked=true
  730. case 4
  731. rb_s4.checked=true
  732. end choose
  733. rb_s1.enabled=false
  734. rb_s2.enabled=false
  735. rb_s3.enabled=false
  736. rb_s4.enabled=false
  737. tab_1.tp_sql.visible=true
  738. tab_1.tp_table.visible=false
  739. tab_1.tp_where.visible=false
  740. tab_1.tp_col.visible=true
  741. tab_1.tp_sort.visible=false
  742. tab_1.tp_procedure.visible=false
  743. tab_1.tp_wbsjy.visible=false
  744. tab_1.tp_sql.mle_1.text=is_sqlselect
  745. l[1]=long(ids2.Object.DataWindow.Column.Count)//字段总数
  746. for j=1 to l[1]
  747. s[1]=ids2.describe("#"+string(j)+'.name')//字段英文名
  748. s[2]=trim(ids2.describe(s[1]+'_t.text'))//字段中文名
  749. if pos('?!',s[2])>0 then//取不到就取字段的tag名
  750. s[2]=trim(ids2.describe(s[1]+'.tag'))
  751. end if
  752. if s[2]='?' then s[2]=s[1]
  753. s[3]=ids2.describe(s[1]+'.coltype')//字段类型
  754. s[4]=ids2.describe(s[1]+'.dbname')
  755. s[5]=ids2.describe(s[1]+'.initial')
  756. ii_row=dw03.insertrow(0)
  757. dw03.setitem(ii_row,'cname',s[1])
  758. dw03.setitem(ii_row,'ctag',s[2])
  759. dw03.setitem(ii_row,'ctype',s[3])
  760. dw03.setitem(ii_row,'cdbname',s[4])
  761. dw03.setitem(ii_row,'cinitial',s[5])
  762. next
  763. if istr_rpt.auto<>'auto' then
  764. ii_rows=dw03.rowcount()
  765. for i=1 to ii_rows
  766. wf_dwclick(dw03,i)
  767. next
  768. end if
  769. tab_1.post selecttab(tab_1.tp_col)
  770. else
  771. choose case ii_sqlno
  772. case 1
  773. rb_s1.postevent(clicked!)
  774. case 2
  775. rb_s2.postevent(clicked!)
  776. case 3
  777. rb_s3.postevent(clicked!)
  778. case 4
  779. rb_s4.postevent(clicked!)
  780. end choose
  781. end if
  782. f_getfont(tab_1.tp_bbgs.ddlb_1)
  783. f_getfont(tab_1.tp_bbgs.ddlb_3)
  784. if istr_rpt.tt='crosstab_auto' then//此参数纯粹为了取参数如istr_rpt.rprocedur2
  785. cb_yes.event clicked()
  786. end if
  787. end event
  788. event close;destroy ids
  789. destroy ids2
  790. end event
  791. event resize;////根据显示分辨率调整对象位置,大小
  792. //if ii_sqlno=1 then
  793. // tab_1.x=0
  794. // tab_1.y=0
  795. // tab_1.width=newwidth
  796. // tab_1.height=newheight
  797. // dw01.x=(newwidth - dw01.width -30)/2
  798. // dw01.height=newheight -150
  799. // dw02.x=(newwidth - dw02.width -30)/2
  800. // dw02.height=newheight -160 -dw05.height
  801. // dw05.x=dw02.x
  802. // dw05.y=dw02.y+dw02.height+8
  803. // ii_temp=newheight -240
  804. // dw03.x=(newwidth - dw03.width -30)/2
  805. // dw03.height=ii_temp
  806. // dw04.x=(newwidth - dw04.width -30)/2
  807. // dw04.height=newheight -150
  808. // tab_1.tp_col.cb_2.x=(newwidth -30)/2 -30 -tab_1.tp_col.cb_2.width
  809. // tab_1.tp_col.cb_3.x=(newwidth -30)/2 +30
  810. // tab_1.tp_sql.mle_1.width=newwidth -2*tab_1.tp_sql.mle_1.x
  811. //end if
  812. end event
  813. event ue_cond;tab_1.SelectTab(3)
  814. end event
  815. type tab_1 from tab within w_rpt_sql
  816. integer x = 5
  817. integer width = 3273
  818. integer height = 1612
  819. integer taborder = 10
  820. boolean bringtotop = true
  821. integer textsize = -9
  822. integer weight = 400
  823. fontpitch fontpitch = variable!
  824. string facename = "宋体"
  825. long backcolor = 80269524
  826. alignment alignment = center!
  827. integer selectedtab = 1
  828. tp_table tp_table
  829. tp_where tp_where
  830. tp_col tp_col
  831. tp_sort tp_sort
  832. tp_sql tp_sql
  833. tp_procedure tp_procedure
  834. tp_wbsjy tp_wbsjy
  835. tp_bbgs tp_bbgs
  836. end type
  837. on tab_1.create
  838. this.tp_table=create tp_table
  839. this.tp_where=create tp_where
  840. this.tp_col=create tp_col
  841. this.tp_sort=create tp_sort
  842. this.tp_sql=create tp_sql
  843. this.tp_procedure=create tp_procedure
  844. this.tp_wbsjy=create tp_wbsjy
  845. this.tp_bbgs=create tp_bbgs
  846. this.Control[]={this.tp_table,&
  847. this.tp_where,&
  848. this.tp_col,&
  849. this.tp_sort,&
  850. this.tp_sql,&
  851. this.tp_procedure,&
  852. this.tp_wbsjy,&
  853. this.tp_bbgs}
  854. end on
  855. on tab_1.destroy
  856. destroy(this.tp_table)
  857. destroy(this.tp_where)
  858. destroy(this.tp_col)
  859. destroy(this.tp_sort)
  860. destroy(this.tp_sql)
  861. destroy(this.tp_procedure)
  862. destroy(this.tp_wbsjy)
  863. destroy(this.tp_bbgs)
  864. end on
  865. event selectionchanged;int j,li_row
  866. string ls_sql,ls_errors
  867. if ii_sqlno<>1 then return
  868. if oldindex=1 and newindex<>1 then
  869. if is_datasource='dw' then//前台
  870. else
  871. wf_getfrom()
  872. if is_from<>is_from_old then//如果选择的表改变
  873. is_from_old=is_from
  874. dw03.reset()
  875. li_row=0
  876. ii_select_count=0
  877. for i=1 to ii_tables
  878. li_row=dw01.getSelectedRow(li_row)
  879. if li_row=0 then exit
  880. s[5]=dw01.getitemstring(li_row,'table_chinese')//表的中文名
  881. s[6]=dw01.getitemstring(li_row,'table_english')//表的英文名
  882. ls_sql='SELECT '+s[6]+'.* from '+s[6]
  883. if ii_tables>1 then
  884. s[2]=mid('ABCDEFGHIJKLMNOPQRSTUVWXYZ',i,1)+s[5]+'.'
  885. else
  886. s[2]=''
  887. end if
  888. ls_errors=f_rpt_gdw(ls_sql,dw03,it_report,s[2],s[6])
  889. next
  890. end if
  891. end if
  892. end if
  893. if newindex=5 then
  894. wf_sql()
  895. tab_1.tp_sql.mle_1.text=is_sqlselect
  896. end if
  897. return
  898. end event
  899. type tp_table from userobject within tab_1
  900. integer x = 18
  901. integer y = 112
  902. integer width = 3237
  903. integer height = 1484
  904. long backcolor = 80269524
  905. string text = "选表或视图"
  906. long tabtextcolor = 33554432
  907. long tabbackcolor = 80269524
  908. string picturename = "Database!"
  909. long picturemaskcolor = 553648127
  910. dw_1 dw_1
  911. end type
  912. on tp_table.create
  913. this.dw_1=create dw_1
  914. this.Control[]={this.dw_1}
  915. end on
  916. on tp_table.destroy
  917. destroy(this.dw_1)
  918. end on
  919. type dw_1 from datawindow within tp_table
  920. integer x = 571
  921. integer y = 4
  922. integer width = 2094
  923. integer height = 1484
  924. integer taborder = 2
  925. boolean bringtotop = true
  926. string dataobject = "dw_rpt_table"
  927. boolean vscrollbar = true
  928. boolean livescroll = true
  929. borderstyle borderstyle = stylelowered!
  930. end type
  931. event clicked;if row>0 then
  932. if getSelectedRow(Row - 1)=row then
  933. SelectRow(Row,false)
  934. else
  935. SelectRow(Row,true)
  936. end if
  937. end if
  938. return 1
  939. end event
  940. type tp_where from userobject within tab_1
  941. integer x = 18
  942. integer y = 112
  943. integer width = 3237
  944. integer height = 1484
  945. long backcolor = 80269524
  946. string text = "关联或条件"
  947. long tabtextcolor = 33554432
  948. long tabbackcolor = 80269524
  949. string picturename = "Join!"
  950. long picturemaskcolor = 553648127
  951. dw_2 dw_2
  952. dw_5 dw_5
  953. end type
  954. on tp_where.create
  955. this.dw_2=create dw_2
  956. this.dw_5=create dw_5
  957. this.Control[]={this.dw_2,&
  958. this.dw_5}
  959. end on
  960. on tp_where.destroy
  961. destroy(this.dw_2)
  962. destroy(this.dw_5)
  963. end on
  964. type dw_2 from datawindow within tp_where
  965. event ue_auto ( )
  966. integer width = 3237
  967. integer height = 1136
  968. integer taborder = 2
  969. string dragicon = "one!"
  970. boolean bringtotop = true
  971. string dataobject = "dw_rpt_relation"
  972. boolean hscrollbar = true
  973. boolean vscrollbar = true
  974. boolean hsplitscroll = true
  975. boolean livescroll = true
  976. borderstyle borderstyle = stylelowered!
  977. end type
  978. event ue_auto;accepttext()
  979. l[1]=getrow()
  980. l[2]=getcolumn()
  981. if l[1]>0 then
  982. choose case l[2]
  983. case 1
  984. s[1]=getitemstring(l[1],1)
  985. if s[1]>'' then
  986. s[2]=getitemstring(l[1],2)
  987. if s[2]='' then setitem(l[1],2,'=')
  988. for i=l[1] -1 to 1 step -1
  989. s[1]=getitemstring(i,1)
  990. s[2]=getitemstring(i,4)
  991. if s[1]>'' and s[2]='' then
  992. setitem(i,4,' and ')
  993. exit
  994. end if
  995. next
  996. end if
  997. case 3,4
  998. s[1]=getitemstring(l[1],1)
  999. s[2]=getitemstring(l[1],2)
  1000. if s[1]>'' and s[2]='' then
  1001. setitem(l[1],2,'=')
  1002. end if
  1003. end choose
  1004. end if
  1005. end event
  1006. event buttonclicked;if row>0 then
  1007. deleterow(row)
  1008. insertrow(0)
  1009. end if
  1010. end event
  1011. event clicked;event ue_auto()
  1012. end event
  1013. event itemchanged;event ue_auto()
  1014. end event
  1015. event rowfocuschanged;event ue_auto()
  1016. end event
  1017. type dw_5 from datawindow within tp_where
  1018. integer y = 1144
  1019. integer width = 3232
  1020. integer height = 340
  1021. integer taborder = 110
  1022. boolean bringtotop = true
  1023. string dataobject = "dw_rpt_argument"
  1024. boolean vscrollbar = true
  1025. boolean livescroll = true
  1026. borderstyle borderstyle = stylelowered!
  1027. end type
  1028. type tp_col from userobject within tab_1
  1029. integer x = 18
  1030. integer y = 112
  1031. integer width = 3237
  1032. integer height = 1484
  1033. long backcolor = 80269524
  1034. string text = "选字段"
  1035. long tabtextcolor = 33554432
  1036. long tabbackcolor = 80269524
  1037. string picturename = "ArrangeIcons!"
  1038. long picturemaskcolor = 553648127
  1039. dw_3 dw_3
  1040. cb_2 cb_2
  1041. cb_3 cb_3
  1042. end type
  1043. on tp_col.create
  1044. this.dw_3=create dw_3
  1045. this.cb_2=create cb_2
  1046. this.cb_3=create cb_3
  1047. this.Control[]={this.dw_3,&
  1048. this.cb_2,&
  1049. this.cb_3}
  1050. end on
  1051. on tp_col.destroy
  1052. destroy(this.dw_3)
  1053. destroy(this.cb_2)
  1054. destroy(this.cb_3)
  1055. end on
  1056. type dw_3 from datawindow within tp_col
  1057. event clicked pbm_dwnlbuttonclk
  1058. integer x = 69
  1059. integer y = 96
  1060. integer width = 2752
  1061. integer height = 1372
  1062. integer taborder = 10
  1063. string dataobject = "dw_rpt_field_drop"
  1064. boolean vscrollbar = true
  1065. boolean livescroll = true
  1066. borderstyle borderstyle = stylelowered!
  1067. end type
  1068. event clicked;wf_dwclick(this,row)
  1069. end event
  1070. type cb_2 from commandbutton within tp_col
  1071. integer x = 1175
  1072. integer y = 12
  1073. integer width = 178
  1074. integer height = 76
  1075. integer taborder = 10
  1076. boolean bringtotop = true
  1077. integer textsize = -9
  1078. integer weight = 400
  1079. fontcharset fontcharset = gb2312charset!
  1080. fontpitch fontpitch = variable!
  1081. string facename = "宋体"
  1082. string text = "全选"
  1083. end type
  1084. event clicked;wf_button(dw_3,1)
  1085. end event
  1086. type cb_3 from commandbutton within tp_col
  1087. integer x = 1399
  1088. integer y = 12
  1089. integer width = 219
  1090. integer height = 76
  1091. integer taborder = 20
  1092. boolean bringtotop = true
  1093. integer textsize = -9
  1094. integer weight = 400
  1095. fontcharset fontcharset = gb2312charset!
  1096. fontpitch fontpitch = variable!
  1097. string facename = "宋体"
  1098. string text = "全不选"
  1099. end type
  1100. event clicked;wf_button(dw_3,-1)
  1101. end event
  1102. type tp_sort from userobject within tab_1
  1103. integer x = 18
  1104. integer y = 112
  1105. integer width = 3237
  1106. integer height = 1484
  1107. long backcolor = 80269524
  1108. string text = "选索引"
  1109. long tabtextcolor = 33554432
  1110. long tabbackcolor = 80269524
  1111. string picturename = "Sort!"
  1112. long picturemaskcolor = 553648127
  1113. dw_4 dw_4
  1114. end type
  1115. on tp_sort.create
  1116. this.dw_4=create dw_4
  1117. this.Control[]={this.dw_4}
  1118. end on
  1119. on tp_sort.destroy
  1120. destroy(this.dw_4)
  1121. end on
  1122. type dw_4 from datawindow within tp_sort
  1123. integer x = 238
  1124. integer y = 12
  1125. integer width = 2405
  1126. integer height = 1460
  1127. integer taborder = 20
  1128. boolean bringtotop = true
  1129. string dataobject = "dw_rpt_sort"
  1130. boolean vscrollbar = true
  1131. boolean livescroll = true
  1132. borderstyle borderstyle = stylelowered!
  1133. end type
  1134. type tp_sql from userobject within tab_1
  1135. integer x = 18
  1136. integer y = 112
  1137. integer width = 3237
  1138. integer height = 1484
  1139. long backcolor = 80269524
  1140. string text = "语句"
  1141. long tabtextcolor = 33554432
  1142. long tabbackcolor = 80269524
  1143. string picturename = "SQL!"
  1144. long picturemaskcolor = 553648127
  1145. mle_1 mle_1
  1146. dw_10 dw_10
  1147. end type
  1148. on tp_sql.create
  1149. this.mle_1=create mle_1
  1150. this.dw_10=create dw_10
  1151. this.Control[]={this.mle_1,&
  1152. this.dw_10}
  1153. end on
  1154. on tp_sql.destroy
  1155. destroy(this.mle_1)
  1156. destroy(this.dw_10)
  1157. end on
  1158. type mle_1 from multilineedit within tp_sql
  1159. integer y = 28
  1160. integer width = 3232
  1161. integer height = 1060
  1162. integer taborder = 20
  1163. boolean bringtotop = true
  1164. integer textsize = -9
  1165. integer weight = 400
  1166. fontcharset fontcharset = gb2312charset!
  1167. fontpitch fontpitch = variable!
  1168. string facename = "宋体"
  1169. long backcolor = 80269524
  1170. boolean vscrollbar = true
  1171. boolean autovscroll = true
  1172. boolean displayonly = true
  1173. borderstyle borderstyle = stylelowered!
  1174. end type
  1175. type dw_10 from datawindow within tp_sql
  1176. integer y = 1100
  1177. integer width = 3227
  1178. integer height = 360
  1179. integer taborder = 90
  1180. boolean bringtotop = true
  1181. string dataobject = "dw_rpt_argument"
  1182. boolean vscrollbar = true
  1183. boolean livescroll = true
  1184. borderstyle borderstyle = stylelowered!
  1185. end type
  1186. type tp_procedure from userobject within tab_1
  1187. integer x = 18
  1188. integer y = 112
  1189. integer width = 3237
  1190. integer height = 1484
  1191. long backcolor = 80269524
  1192. string text = "存储过程"
  1193. long tabtextcolor = 33554432
  1194. long tabbackcolor = 80269524
  1195. string picturename = "DeclareProcedure!"
  1196. long picturemaskcolor = 553648127
  1197. dw_6 dw_6
  1198. sle_1 sle_1
  1199. st_1 st_1
  1200. st_2 st_2
  1201. end type
  1202. on tp_procedure.create
  1203. this.dw_6=create dw_6
  1204. this.sle_1=create sle_1
  1205. this.st_1=create st_1
  1206. this.st_2=create st_2
  1207. this.Control[]={this.dw_6,&
  1208. this.sle_1,&
  1209. this.st_1,&
  1210. this.st_2}
  1211. end on
  1212. on tp_procedure.destroy
  1213. destroy(this.dw_6)
  1214. destroy(this.sle_1)
  1215. destroy(this.st_1)
  1216. destroy(this.st_2)
  1217. end on
  1218. type dw_6 from datawindow within tp_procedure
  1219. integer x = 78
  1220. integer y = 780
  1221. integer width = 2802
  1222. integer height = 604
  1223. integer taborder = 120
  1224. boolean bringtotop = true
  1225. string dataobject = "dw_rpt_argument"
  1226. boolean vscrollbar = true
  1227. boolean livescroll = true
  1228. borderstyle borderstyle = stylelowered!
  1229. end type
  1230. type sle_1 from singlelineedit within tp_procedure
  1231. integer x = 78
  1232. integer y = 212
  1233. integer width = 2802
  1234. integer height = 92
  1235. integer taborder = 50
  1236. boolean bringtotop = true
  1237. integer textsize = -9
  1238. integer weight = 400
  1239. fontcharset fontcharset = gb2312charset!
  1240. fontpitch fontpitch = variable!
  1241. string facename = "宋体"
  1242. long textcolor = 33554432
  1243. boolean autohscroll = false
  1244. borderstyle borderstyle = stylelowered!
  1245. end type
  1246. type st_1 from statictext within tp_procedure
  1247. integer x = 78
  1248. integer y = 116
  1249. integer width = 2802
  1250. integer height = 76
  1251. boolean bringtotop = true
  1252. integer textsize = -9
  1253. integer weight = 400
  1254. fontcharset fontcharset = gb2312charset!
  1255. fontpitch fontpitch = variable!
  1256. string facename = "宋体"
  1257. long textcolor = 33554432
  1258. long backcolor = 80269524
  1259. boolean enabled = false
  1260. string text = "存储过程名称(如:sp_name)"
  1261. boolean focusrectangle = false
  1262. end type
  1263. type st_2 from statictext within tp_procedure
  1264. integer x = 78
  1265. integer y = 672
  1266. integer width = 2802
  1267. integer height = 76
  1268. boolean bringtotop = true
  1269. integer textsize = -9
  1270. integer weight = 400
  1271. fontcharset fontcharset = gb2312charset!
  1272. fontpitch fontpitch = variable!
  1273. string facename = "宋体"
  1274. long textcolor = 33554432
  1275. long backcolor = 67108864
  1276. boolean enabled = false
  1277. string text = "存储过程参数"
  1278. boolean focusrectangle = false
  1279. end type
  1280. type tp_wbsjy from userobject within tab_1
  1281. integer x = 18
  1282. integer y = 112
  1283. integer width = 3237
  1284. integer height = 1484
  1285. long backcolor = 80269524
  1286. string text = "外部数据源"
  1287. long tabtextcolor = 33554432
  1288. long tabbackcolor = 80269524
  1289. string picturename = "ScriptYes!"
  1290. long picturemaskcolor = 553648127
  1291. dw_7 dw_7
  1292. end type
  1293. on tp_wbsjy.create
  1294. this.dw_7=create dw_7
  1295. this.Control[]={this.dw_7}
  1296. end on
  1297. on tp_wbsjy.destroy
  1298. destroy(this.dw_7)
  1299. end on
  1300. type dw_7 from datawindow within tp_wbsjy
  1301. integer x = 197
  1302. integer y = 24
  1303. integer width = 2583
  1304. integer height = 1440
  1305. integer taborder = 20
  1306. boolean bringtotop = true
  1307. string dataobject = "dw_rpt_wbsjy"
  1308. boolean vscrollbar = true
  1309. boolean livescroll = true
  1310. borderstyle borderstyle = stylelowered!
  1311. end type
  1312. type tp_bbgs from userobject within tab_1
  1313. event create ( )
  1314. event destroy ( )
  1315. integer x = 18
  1316. integer y = 112
  1317. integer width = 3237
  1318. integer height = 1484
  1319. long backcolor = 80269524
  1320. string text = "数据窗口格式"
  1321. long tabtextcolor = 33554432
  1322. long tabbackcolor = 80269524
  1323. string picturename = "RunReport!"
  1324. long picturemaskcolor = 553648127
  1325. gb_3 gb_3
  1326. gb_2 gb_2
  1327. gb_1 gb_1
  1328. rb_1 rb_1
  1329. rb_2 rb_2
  1330. rb_3 rb_3
  1331. ddlb_1 ddlb_1
  1332. dw_8 dw_8
  1333. ddlb_3 ddlb_3
  1334. dw_9 dw_9
  1335. ddlb_2 ddlb_2
  1336. ddlb_4 ddlb_4
  1337. rb_6 rb_6
  1338. rb_5 rb_5
  1339. rb_7 rb_7
  1340. rb_9 rb_9
  1341. rb_4 rb_4
  1342. rb_8 rb_8
  1343. rb_10 rb_10
  1344. em_1 em_1
  1345. st_3 st_3
  1346. end type
  1347. on tp_bbgs.create
  1348. this.gb_3=create gb_3
  1349. this.gb_2=create gb_2
  1350. this.gb_1=create gb_1
  1351. this.rb_1=create rb_1
  1352. this.rb_2=create rb_2
  1353. this.rb_3=create rb_3
  1354. this.ddlb_1=create ddlb_1
  1355. this.dw_8=create dw_8
  1356. this.ddlb_3=create ddlb_3
  1357. this.dw_9=create dw_9
  1358. this.ddlb_2=create ddlb_2
  1359. this.ddlb_4=create ddlb_4
  1360. this.rb_6=create rb_6
  1361. this.rb_5=create rb_5
  1362. this.rb_7=create rb_7
  1363. this.rb_9=create rb_9
  1364. this.rb_4=create rb_4
  1365. this.rb_8=create rb_8
  1366. this.rb_10=create rb_10
  1367. this.em_1=create em_1
  1368. this.st_3=create st_3
  1369. this.Control[]={this.gb_3,&
  1370. this.gb_2,&
  1371. this.gb_1,&
  1372. this.rb_1,&
  1373. this.rb_2,&
  1374. this.rb_3,&
  1375. this.ddlb_1,&
  1376. this.dw_8,&
  1377. this.ddlb_3,&
  1378. this.dw_9,&
  1379. this.ddlb_2,&
  1380. this.ddlb_4,&
  1381. this.rb_6,&
  1382. this.rb_5,&
  1383. this.rb_7,&
  1384. this.rb_9,&
  1385. this.rb_4,&
  1386. this.rb_8,&
  1387. this.rb_10,&
  1388. this.em_1,&
  1389. this.st_3}
  1390. end on
  1391. on tp_bbgs.destroy
  1392. destroy(this.gb_3)
  1393. destroy(this.gb_2)
  1394. destroy(this.gb_1)
  1395. destroy(this.rb_1)
  1396. destroy(this.rb_2)
  1397. destroy(this.rb_3)
  1398. destroy(this.ddlb_1)
  1399. destroy(this.dw_8)
  1400. destroy(this.ddlb_3)
  1401. destroy(this.dw_9)
  1402. destroy(this.ddlb_2)
  1403. destroy(this.ddlb_4)
  1404. destroy(this.rb_6)
  1405. destroy(this.rb_5)
  1406. destroy(this.rb_7)
  1407. destroy(this.rb_9)
  1408. destroy(this.rb_4)
  1409. destroy(this.rb_8)
  1410. destroy(this.rb_10)
  1411. destroy(this.em_1)
  1412. destroy(this.st_3)
  1413. end on
  1414. event constructor;st_3.visible=false
  1415. em_1.visible=false
  1416. end event
  1417. type gb_3 from groupbox within tp_bbgs
  1418. integer x = 1787
  1419. integer y = 792
  1420. integer width = 1024
  1421. integer height = 608
  1422. integer taborder = 30
  1423. integer textsize = -9
  1424. integer weight = 400
  1425. fontpitch fontpitch = variable!
  1426. string facename = "宋体"
  1427. long textcolor = 33554432
  1428. long backcolor = 80269524
  1429. string text = "内容字体"
  1430. end type
  1431. type gb_2 from groupbox within tp_bbgs
  1432. integer x = 1792
  1433. integer y = 60
  1434. integer width = 1024
  1435. integer height = 608
  1436. integer taborder = 20
  1437. integer textsize = -9
  1438. integer weight = 400
  1439. fontpitch fontpitch = variable!
  1440. string facename = "宋体"
  1441. long textcolor = 33554432
  1442. long backcolor = 80269524
  1443. string text = "标题字体"
  1444. end type
  1445. type gb_1 from groupbox within tp_bbgs
  1446. integer x = 46
  1447. integer y = 56
  1448. integer width = 1504
  1449. integer height = 1356
  1450. integer taborder = 10
  1451. integer textsize = -9
  1452. integer weight = 400
  1453. fontcharset fontcharset = gb2312charset!
  1454. fontpitch fontpitch = variable!
  1455. string facename = "宋体"
  1456. long backcolor = 80269524
  1457. string text = "数据窗口类型"
  1458. end type
  1459. type rb_1 from radiobutton within tp_bbgs
  1460. event clicked pbm_bnclicked
  1461. integer x = 201
  1462. integer y = 148
  1463. integer width = 987
  1464. integer height = 76
  1465. boolean bringtotop = true
  1466. integer textsize = -9
  1467. integer weight = 400
  1468. fontpitch fontpitch = variable!
  1469. string facename = "宋体"
  1470. long textcolor = 33554432
  1471. long backcolor = 80269524
  1472. string text = " 1 FreeForm - 表格式(标准宽度)"
  1473. boolean checked = true
  1474. end type
  1475. event clicked;wf_bbgs(text)
  1476. checked=true
  1477. end event
  1478. type rb_2 from radiobutton within tp_bbgs
  1479. event clicked pbm_bnclicked
  1480. integer x = 201
  1481. integer y = 228
  1482. integer width = 987
  1483. integer height = 76
  1484. boolean bringtotop = true
  1485. integer textsize = -9
  1486. integer weight = 400
  1487. fontpitch fontpitch = variable!
  1488. string facename = "宋体"
  1489. long textcolor = 33554432
  1490. long backcolor = 80269524
  1491. string text = " 2 FreeForm - 表格式(压缩宽度)"
  1492. end type
  1493. event clicked;wf_bbgs(text)
  1494. checked=true
  1495. end event
  1496. type rb_3 from radiobutton within tp_bbgs
  1497. event clicked pbm_bnclicked
  1498. integer x = 201
  1499. integer y = 308
  1500. integer width = 987
  1501. integer height = 92
  1502. boolean bringtotop = true
  1503. integer textsize = -9
  1504. integer weight = 400
  1505. fontpitch fontpitch = variable!
  1506. string facename = "宋体"
  1507. long textcolor = 33554432
  1508. long backcolor = 80269524
  1509. string text = " 3 FreeForm - 纯自由式"
  1510. end type
  1511. event clicked;wf_bbgs(text)
  1512. checked=true
  1513. end event
  1514. type ddlb_1 from dropdownlistbox within tp_bbgs
  1515. event selectionchanged pbm_cbnselchange
  1516. integer x = 1833
  1517. integer y = 136
  1518. integer width = 736
  1519. integer height = 492
  1520. integer taborder = 40
  1521. boolean bringtotop = true
  1522. integer textsize = -9
  1523. integer weight = 400
  1524. fontpitch fontpitch = variable!
  1525. string facename = "宋体"
  1526. long backcolor = 16777215
  1527. string text = "宋体"
  1528. boolean vscrollbar = true
  1529. end type
  1530. event selectionchanged;dw_8.modify("text_1.font.face='"+this.text+"'")
  1531. end event
  1532. type dw_8 from datawindow within tp_bbgs
  1533. integer x = 1829
  1534. integer y = 280
  1535. integer width = 942
  1536. integer height = 356
  1537. integer taborder = 50
  1538. boolean bringtotop = true
  1539. string dataobject = "dw_rpt_font"
  1540. boolean border = false
  1541. boolean livescroll = true
  1542. end type
  1543. type ddlb_3 from dropdownlistbox within tp_bbgs
  1544. event selectionchanged pbm_cbnselchange
  1545. integer x = 1824
  1546. integer y = 868
  1547. integer width = 736
  1548. integer height = 492
  1549. integer taborder = 70
  1550. boolean bringtotop = true
  1551. integer textsize = -9
  1552. integer weight = 400
  1553. fontpitch fontpitch = variable!
  1554. string facename = "宋体"
  1555. long backcolor = 16777215
  1556. string text = "宋体"
  1557. boolean vscrollbar = true
  1558. end type
  1559. event selectionchanged;dw_9.modify("text_1.font.face='"+this.text+"'")
  1560. end event
  1561. type dw_9 from datawindow within tp_bbgs
  1562. integer x = 1824
  1563. integer y = 1012
  1564. integer width = 942
  1565. integer height = 356
  1566. integer taborder = 80
  1567. boolean bringtotop = true
  1568. string dataobject = "dw_rpt_font"
  1569. boolean border = false
  1570. boolean livescroll = true
  1571. end type
  1572. type ddlb_2 from dropdownlistbox within tp_bbgs
  1573. event selectionchanged pbm_cbnselchange
  1574. integer x = 2578
  1575. integer y = 136
  1576. integer width = 192
  1577. integer height = 492
  1578. integer taborder = 60
  1579. boolean bringtotop = true
  1580. integer textsize = -9
  1581. integer weight = 400
  1582. fontpitch fontpitch = variable!
  1583. string facename = "宋体"
  1584. long backcolor = 16777215
  1585. string text = "18"
  1586. boolean allowedit = true
  1587. boolean sorted = false
  1588. boolean vscrollbar = true
  1589. string item[] = {"8","9","10","11","12","14","16","18","20","22","24","26","28","36","48","72"}
  1590. end type
  1591. event selectionchanged;dw_8.modify("text_1.font.height='"+this.text+"'")
  1592. end event
  1593. type ddlb_4 from dropdownlistbox within tp_bbgs
  1594. event selectionchanged pbm_cbnselchange
  1595. integer x = 2574
  1596. integer y = 868
  1597. integer width = 192
  1598. integer height = 492
  1599. integer taborder = 90
  1600. boolean bringtotop = true
  1601. integer textsize = -9
  1602. integer weight = 400
  1603. fontpitch fontpitch = variable!
  1604. string facename = "宋体"
  1605. long backcolor = 16777215
  1606. string text = "9"
  1607. boolean allowedit = true
  1608. boolean sorted = false
  1609. boolean vscrollbar = true
  1610. string item[] = {"8","9","10","11","12","14","16","18","20","22","24","26","28","36","48","72"}
  1611. end type
  1612. event selectionchanged;dw_9.modify("text_1.font.height='"+this.text+"'")
  1613. end event
  1614. type rb_6 from radiobutton within tp_bbgs
  1615. integer x = 201
  1616. integer y = 564
  1617. integer width = 987
  1618. integer height = 76
  1619. boolean bringtotop = true
  1620. integer textsize = -9
  1621. integer weight = 400
  1622. fontcharset fontcharset = gb2312charset!
  1623. fontpitch fontpitch = variable!
  1624. string facename = "宋体"
  1625. long textcolor = 33554432
  1626. long backcolor = 67108864
  1627. string text = " 6 Grid - 网格"
  1628. end type
  1629. event clicked;wf_bbgs(text)
  1630. checked=true
  1631. end event
  1632. type rb_5 from radiobutton within tp_bbgs
  1633. integer x = 201
  1634. integer y = 484
  1635. integer width = 658
  1636. integer height = 76
  1637. boolean bringtotop = true
  1638. integer textsize = -9
  1639. integer weight = 400
  1640. fontcharset fontcharset = gb2312charset!
  1641. fontpitch fontpitch = variable!
  1642. string facename = "宋体"
  1643. long textcolor = 33554432
  1644. long backcolor = 67108864
  1645. string text = " 5 N-UP - 格式"
  1646. end type
  1647. event clicked;wf_bbgs(text)
  1648. checked=true
  1649. end event
  1650. type rb_7 from radiobutton within tp_bbgs
  1651. integer x = 201
  1652. integer y = 644
  1653. integer width = 987
  1654. integer height = 76
  1655. boolean bringtotop = true
  1656. integer textsize = -9
  1657. integer weight = 400
  1658. fontcharset fontcharset = gb2312charset!
  1659. fontpitch fontpitch = variable!
  1660. string facename = "宋体"
  1661. long textcolor = 33554432
  1662. long backcolor = 67108864
  1663. string text = " 7 Label - 标签格式"
  1664. end type
  1665. event clicked;wf_bbgs(text)
  1666. checked=true
  1667. end event
  1668. type rb_9 from radiobutton within tp_bbgs
  1669. integer x = 201
  1670. integer y = 804
  1671. integer width = 987
  1672. integer height = 76
  1673. boolean bringtotop = true
  1674. integer textsize = -9
  1675. integer weight = 400
  1676. fontcharset fontcharset = gb2312charset!
  1677. fontpitch fontpitch = variable!
  1678. string facename = "宋体"
  1679. long textcolor = 33554432
  1680. long backcolor = 67108864
  1681. string text = " 9 Crosstab - 交叉表"
  1682. end type
  1683. event clicked;wf_bbgs(text)
  1684. checked=true
  1685. end event
  1686. type rb_4 from radiobutton within tp_bbgs
  1687. integer x = 201
  1688. integer y = 404
  1689. integer width = 987
  1690. integer height = 76
  1691. boolean bringtotop = true
  1692. integer textsize = -9
  1693. integer weight = 400
  1694. fontcharset fontcharset = gb2312charset!
  1695. fontpitch fontpitch = variable!
  1696. string facename = "宋体"
  1697. long textcolor = 33554432
  1698. long backcolor = 67108864
  1699. string text = " 4 Tabular - 格式"
  1700. end type
  1701. event clicked;wf_bbgs(text)
  1702. checked=true
  1703. end event
  1704. type rb_8 from radiobutton within tp_bbgs
  1705. integer x = 201
  1706. integer y = 724
  1707. integer width = 987
  1708. integer height = 76
  1709. boolean bringtotop = true
  1710. integer textsize = -9
  1711. integer weight = 400
  1712. fontcharset fontcharset = gb2312charset!
  1713. fontpitch fontpitch = variable!
  1714. string facename = "宋体"
  1715. long textcolor = 33554432
  1716. long backcolor = 67108864
  1717. string text = " 8 Graph - 图表"
  1718. end type
  1719. event clicked;wf_bbgs(text)
  1720. checked=true
  1721. end event
  1722. type rb_10 from radiobutton within tp_bbgs
  1723. integer x = 201
  1724. integer y = 884
  1725. integer width = 987
  1726. integer height = 76
  1727. boolean bringtotop = true
  1728. integer textsize = -9
  1729. integer weight = 400
  1730. fontcharset fontcharset = gb2312charset!
  1731. fontpitch fontpitch = variable!
  1732. string facename = "宋体"
  1733. long textcolor = 33554432
  1734. long backcolor = 67108864
  1735. string text = "10 Composite - 复合表"
  1736. end type
  1737. event clicked;wf_bbgs(text)
  1738. checked=true
  1739. rb_s3.postevent(clicked!)
  1740. end event
  1741. type em_1 from editmask within tp_bbgs
  1742. integer x = 1330
  1743. integer y = 480
  1744. integer width = 178
  1745. integer height = 84
  1746. integer taborder = 60
  1747. boolean bringtotop = true
  1748. integer textsize = -9
  1749. integer weight = 400
  1750. fontcharset fontcharset = gb2312charset!
  1751. fontpitch fontpitch = variable!
  1752. string facename = "宋体"
  1753. long textcolor = 33554432
  1754. string text = "2"
  1755. alignment alignment = right!
  1756. borderstyle borderstyle = stylelowered!
  1757. string mask = "0"
  1758. boolean spin = true
  1759. double increment = 1
  1760. end type
  1761. type st_3 from statictext within tp_bbgs
  1762. integer x = 878
  1763. integer y = 492
  1764. integer width = 453
  1765. integer height = 76
  1766. boolean bringtotop = true
  1767. integer textsize = -9
  1768. integer weight = 400
  1769. fontcharset fontcharset = gb2312charset!
  1770. fontpitch fontpitch = variable!
  1771. string facename = "宋体"
  1772. long textcolor = 33554432
  1773. long backcolor = 67108864
  1774. boolean enabled = false
  1775. string text = "- 细节区重复行数"
  1776. alignment alignment = center!
  1777. boolean focusrectangle = false
  1778. end type
  1779. type dw11 from datawindow within w_rpt_sql
  1780. boolean visible = false
  1781. integer x = 841
  1782. integer y = 1764
  1783. integer width = 1262
  1784. integer height = 368
  1785. integer taborder = 20
  1786. boolean bringtotop = true
  1787. string dataobject = "dw_rpt_column"
  1788. boolean hscrollbar = true
  1789. boolean vscrollbar = true
  1790. boolean hsplitscroll = true
  1791. boolean livescroll = true
  1792. end type
  1793. type rb_s1 from radiobutton within w_rpt_sql
  1794. integer x = 41
  1795. integer y = 1632
  1796. integer width = 439
  1797. integer height = 76
  1798. boolean bringtotop = true
  1799. integer textsize = -9
  1800. integer weight = 400
  1801. fontcharset fontcharset = gb2312charset!
  1802. fontpitch fontpitch = variable!
  1803. string facename = "宋体"
  1804. long textcolor = 33554432
  1805. long backcolor = 67108864
  1806. string text = "视图方式"
  1807. boolean checked = true
  1808. end type
  1809. event clicked;ii_sqlno=1
  1810. tab_1.tp_table.visible=true
  1811. tab_1.selecttab(tab_1.tp_table)
  1812. tab_1.tp_sql.visible=true
  1813. tab_1.tp_sql.mle_1.displayonly=true
  1814. tab_1.tp_sql.mle_1.BackColor=80269524
  1815. tab_1.tp_where.visible=true
  1816. tab_1.tp_col.visible=true
  1817. tab_1.tp_sort.visible=true
  1818. tab_1.tp_procedure.visible=false
  1819. tab_1.tp_wbsjy.visible=false
  1820. checked=true
  1821. end event
  1822. type rb_s2 from radiobutton within w_rpt_sql
  1823. integer x = 457
  1824. integer y = 1632
  1825. integer width = 439
  1826. integer height = 76
  1827. boolean bringtotop = true
  1828. integer textsize = -9
  1829. integer weight = 400
  1830. fontcharset fontcharset = gb2312charset!
  1831. fontpitch fontpitch = variable!
  1832. string facename = "宋体"
  1833. long textcolor = 33554432
  1834. long backcolor = 67108864
  1835. string text = "直接写SQL语句"
  1836. end type
  1837. event clicked;ii_sqlno=2
  1838. tab_1.tp_sql.visible=true
  1839. tab_1.tp_sql.mle_1.displayonly=false
  1840. tab_1.tp_sql.mle_1.BackColor=16777215
  1841. tab_1.selecttab(tab_1.tp_sql)
  1842. tab_1.tp_table.visible=false
  1843. tab_1.tp_where.visible=false
  1844. tab_1.tp_col.visible=false
  1845. tab_1.tp_sort.visible=false
  1846. tab_1.tp_procedure.visible=false
  1847. tab_1.tp_wbsjy.visible=false
  1848. tab_1.tp_sql.mle_1.text=is_sqlselect
  1849. checked=true
  1850. end event
  1851. type rb_s3 from radiobutton within w_rpt_sql
  1852. integer x = 983
  1853. integer y = 1632
  1854. integer width = 439
  1855. integer height = 76
  1856. boolean bringtotop = true
  1857. integer textsize = -9
  1858. integer weight = 400
  1859. fontcharset fontcharset = gb2312charset!
  1860. fontpitch fontpitch = variable!
  1861. string facename = "宋体"
  1862. long textcolor = 33554432
  1863. long backcolor = 67108864
  1864. string text = "外部数据源"
  1865. end type
  1866. event clicked;ii_sqlno=3
  1867. tab_1.tp_wbsjy.visible=true
  1868. tab_1.selecttab(tab_1.tp_wbsjy)
  1869. tab_1.tp_table.visible=false
  1870. tab_1.tp_where.visible=false
  1871. tab_1.tp_col.visible=false
  1872. tab_1.tp_sort.visible=false
  1873. tab_1.tp_sql.visible=false
  1874. tab_1.tp_procedure.visible=false
  1875. checked=true
  1876. end event
  1877. type rb_s4 from radiobutton within w_rpt_sql
  1878. integer x = 1454
  1879. integer y = 1632
  1880. integer width = 439
  1881. integer height = 76
  1882. boolean bringtotop = true
  1883. integer textsize = -9
  1884. integer weight = 400
  1885. fontcharset fontcharset = gb2312charset!
  1886. fontpitch fontpitch = variable!
  1887. string facename = "宋体"
  1888. long textcolor = 33554432
  1889. long backcolor = 67108864
  1890. string text = "存储过程"
  1891. end type
  1892. event clicked;ii_sqlno=4
  1893. tab_1.tp_procedure.visible=true
  1894. tab_1.tp_table.visible=false
  1895. tab_1.tp_where.visible=false
  1896. tab_1.tp_col.visible=false
  1897. tab_1.tp_sort.visible=false
  1898. tab_1.tp_sql.visible=false
  1899. tab_1.tp_wbsjy.visible=false
  1900. tab_1.selecttab(tab_1.tp_procedure)
  1901. checked=true
  1902. end event
  1903. type cb_yes from commandbutton within w_rpt_sql
  1904. integer x = 2181
  1905. integer y = 1624
  1906. integer width = 265
  1907. integer height = 88
  1908. integer taborder = 30
  1909. boolean bringtotop = true
  1910. integer textsize = -9
  1911. integer weight = 400
  1912. fontpitch fontpitch = variable!
  1913. string facename = "宋体"
  1914. string text = "确定(&Y)"
  1915. end type
  1916. event clicked;dw11.reset()
  1917. dw02.accepttext()
  1918. dw04.accepttext()
  1919. dw05.accepttext()
  1920. dw06.accepttext()
  1921. dw07.accepttext()
  1922. dw10.accepttext()
  1923. if is_datasource='dw' then//前台
  1924. wf_sql()//处理is_sqlselect和coldw
  1925. else
  1926. choose case ii_sqlno
  1927. case 1//视图方式
  1928. is_procedure=''
  1929. tab_1.event selectionchanged(1,3)//先选字段后再去改选表,需要触发此事件
  1930. wf_sql()//处理is_sqlselect和coldw
  1931. if is_from='' then
  1932. is_temp='请选择表名.'
  1933. goto myerror
  1934. end if
  1935. if ids.rowcount()=0 then
  1936. is_temp='请选择字段.'
  1937. goto myerror
  1938. end if
  1939. if is_where='' and pos(is_from,',')>0 then
  1940. is_temp='请选择关联.'
  1941. goto myerror
  1942. end if
  1943. if wf_dw11(is_sqlselect)=1 then return
  1944. case 2//直接写SQL语句
  1945. is_procedure=''
  1946. s[1]=tab_1.tp_sql.mle_1.text
  1947. if wf_dw11(s[1])=1 then return
  1948. if right(s[1],1)<>'~n' then s[1]=s[1]+'~n'//为了在OPEN事件中好识别是直接写SQL语句
  1949. is_sqlselect=s[1]
  1950. case 3//外部数据源
  1951. is_sqlselect=''
  1952. is_procedure=''
  1953. ii_rows=dw07.rowcount()
  1954. for i=1 to ii_rows
  1955. s[1]=dw07.getitemstring(i,1)
  1956. s[2]=dw07.getitemstring(i,2)
  1957. dw11.insertrow(0)
  1958. dw11.setitem(i,'cname',s[1])
  1959. dw11.setitem(i,'cdbname',s[1])
  1960. dw11.setitem(i,'ctag',s[1])
  1961. if s[2]='decimal' then
  1962. dw11.setitem(i,'ctype','decimal('+string(dw07.object.data[i,4])+')')
  1963. elseif s[2]='string' then
  1964. dw11.setitem(i,'ctype','char('+string(dw07.object.data[i,3])+')')
  1965. else
  1966. dw11.setitem(i,'ctype',s[2])
  1967. end if
  1968. next
  1969. case 4//存储过程//execute dba.sp3 '',''
  1970. is_sqlselect=''
  1971. s[1]=tab_1.tp_procedure.sle_1.text
  1972. s[1]='execute '+s[1]+' '
  1973. ii_rows=dw05.rowcount()
  1974. for i=1 to ii_rows//提取参数
  1975. s[3]=trim(dw05.getitemstring(i,1))
  1976. if s[3]='' then continue
  1977. s[1]=s[1]+':'+s[3]+','
  1978. next
  1979. if right(s[1],1)=',' then s[1]=left(s[1],len(s[1])-1)
  1980. if wf_dw11(s[1])=1 then return
  1981. is_procedure=s[1]
  1982. end choose
  1983. end if
  1984. if ii_bbgs<>9 then//非crosstab
  1985. if istr_rpt.auto='auto' then
  1986. if ii_sqlno=1 and pos(is_from,',')=0 then
  1987. win_parent.is_updatetable=is_from
  1988. end if
  1989. ii_band_size=long(tab_1.tp_bbgs.ddlb_4.text)*4/3
  1990. ii_rows=dw11.rowcount()
  1991. for i=1 to ii_rows
  1992. s[1]=dw11.getitemstring(i,'ctag')
  1993. s[2]=dw11.getitemstring(i,'ctype')
  1994. dw11.setitem(i,'clen1',len(s[1])*ii_band_size/2)//字段标题象素
  1995. dw11.setitem(i,'clen2',min(f_clen(s[2])*ii_band_size/2,800))
  1996. next
  1997. end if
  1998. ii_rows=dw11.rowcount()
  1999. for i=1 to ii_rows//恢复设置的initial,value,
  2000. is_temp=dw11.getitemstring(i,'cdbname')
  2001. ii_row=win_parent.dw3.find("cdbname='"+is_temp+"'",1,999)
  2002. if ii_row>0 then
  2003. dw11.setitem(i,'cinitial',win_parent.dw3.getitemstring(ii_row,'cinitial'))
  2004. dw11.setitem(i,'cvalues',win_parent.dw3.getitemstring(ii_row,'cvalues'))
  2005. dw11.setitem(i,'cvalidation',win_parent.dw3.getitemstring(ii_row,'cvalidation'))
  2006. dw11.setitem(i,'cvalidationmsg',win_parent.dw3.getitemstring(ii_row,'cvalidationmsg'))
  2007. dw11.setitem(i,'cidentity',win_parent.dw3.getitemstring(ii_row,'cidentity'))
  2008. end if
  2009. next
  2010. win_parent.dw3.reset()
  2011. dw11.RowsCopy(1,dw11.RowCount(),Primary!,win_parent.dw3,1,Primary!)
  2012. end if
  2013. if is_datasource<>'dw' then//后台
  2014. wf_arg()
  2015. istr_rpt.rsqlselect=is_sqlselect
  2016. istr_rpt.rarguments=is_arguments
  2017. istr_rpt.rprocedure=is_procedure
  2018. end if
  2019. if istr_rpt.auto='auto' then
  2020. istr_rpt.tt=string(ii_bbgs)
  2021. istr_rpt.t1=tab_1.tp_bbgs.ddlb_1.text//title font name
  2022. istr_rpt.t2=string(round(long(tab_1.tp_bbgs.ddlb_2.text)*4/3,0))//title font size
  2023. istr_rpt.t3=tab_1.tp_bbgs.ddlb_3.text//band font name
  2024. istr_rpt.t4=string(round(long(tab_1.tp_bbgs.ddlb_4.text)*4/3,0))
  2025. istr_rpt.t5=tab_1.tp_bbgs.em_1.text
  2026. end if
  2027. closewithreturn(parent,istr_rpt)
  2028. return
  2029. myerror:
  2030. //清除已经生成的有关字段
  2031. ids.setfilter("")
  2032. ids.setsort("")
  2033. messagebox('提示信息',is_temp)
  2034. return
  2035. end event
  2036. type cb_no from commandbutton within w_rpt_sql
  2037. integer x = 2587
  2038. integer y = 1624
  2039. integer width = 265
  2040. integer height = 88
  2041. integer taborder = 40
  2042. boolean bringtotop = true
  2043. integer textsize = -9
  2044. integer weight = 400
  2045. fontpitch fontpitch = variable!
  2046. string facename = "宋体"
  2047. string text = "取消(&N)"
  2048. end type
  2049. event clicked;close(parent)
  2050. end event