w_rp_combine_setting.srw 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100
  1. $PBExportHeader$w_rp_combine_setting.srw
  2. forward
  3. global type w_rp_combine_setting from w_publ_base
  4. end type
  5. type cb_add1 from uo_imflatbutton within w_rp_combine_setting
  6. end type
  7. type dw_2 from u_dw_rbtnfilter within w_rp_combine_setting
  8. end type
  9. type dw_3 from u_dw_rbtnfilter within w_rp_combine_setting
  10. end type
  11. type cb_mod1 from uo_imflatbutton within w_rp_combine_setting
  12. end type
  13. type cb_del1 from uo_imflatbutton within w_rp_combine_setting
  14. end type
  15. type cb_add2 from uo_imflatbutton within w_rp_combine_setting
  16. end type
  17. type cb_mod2 from uo_imflatbutton within w_rp_combine_setting
  18. end type
  19. type cb_del2 from uo_imflatbutton within w_rp_combine_setting
  20. end type
  21. type cb_add3 from uo_imflatbutton within w_rp_combine_setting
  22. end type
  23. type cb_mod3 from uo_imflatbutton within w_rp_combine_setting
  24. end type
  25. type cb_del3 from uo_imflatbutton within w_rp_combine_setting
  26. end type
  27. type cb_set2 from uo_imflatbutton within w_rp_combine_setting
  28. end type
  29. type cb_set3 from uo_imflatbutton within w_rp_combine_setting
  30. end type
  31. type st_1 from statictext within w_rp_combine_setting
  32. end type
  33. type ln_bar from line within w_rp_combine_setting
  34. end type
  35. type ln_bar2 from line within w_rp_combine_setting
  36. end type
  37. type r_bar from rectangle within w_rp_combine_setting
  38. end type
  39. type ln_1 from line within w_rp_combine_setting
  40. end type
  41. type ln_2 from line within w_rp_combine_setting
  42. end type
  43. type ddlb_1 from dropdownlistbox within w_rp_combine_setting
  44. end type
  45. type cb_input_file from uo_imflatbutton within w_rp_combine_setting
  46. end type
  47. type cb_output_file from uo_imflatbutton within w_rp_combine_setting
  48. end type
  49. type dw_1 from datawindow within w_rp_combine_setting
  50. end type
  51. end forward
  52. global type w_rp_combine_setting from w_publ_base
  53. integer width = 4073
  54. integer height = 2432
  55. string title = "设置"
  56. boolean minbox = false
  57. windowtype windowtype = response!
  58. event retr_mx ( )
  59. cb_add1 cb_add1
  60. dw_2 dw_2
  61. dw_3 dw_3
  62. cb_mod1 cb_mod1
  63. cb_del1 cb_del1
  64. cb_add2 cb_add2
  65. cb_mod2 cb_mod2
  66. cb_del2 cb_del2
  67. cb_add3 cb_add3
  68. cb_mod3 cb_mod3
  69. cb_del3 cb_del3
  70. cb_set2 cb_set2
  71. cb_set3 cb_set3
  72. st_1 st_1
  73. ln_bar ln_bar
  74. ln_bar2 ln_bar2
  75. r_bar r_bar
  76. ln_1 ln_1
  77. ln_2 ln_2
  78. ddlb_1 ddlb_1
  79. cb_input_file cb_input_file
  80. cb_output_file cb_output_file
  81. dw_1 dw_1
  82. end type
  83. global w_rp_combine_setting w_rp_combine_setting
  84. type variables
  85. Long cur_rpid
  86. s_rp_rowid s_rowid[]
  87. end variables
  88. forward prototypes
  89. public subroutine wf_face ()
  90. public subroutine wf_ddlb ()
  91. end prototypes
  92. event retr_mx();If cur_rpid <= 0 Then
  93. dw_2.Reset()
  94. dw_3.Reset()
  95. Else
  96. dw_2.Retrieve(cur_rpid,0)
  97. dw_3.Retrieve(cur_rpid,1)
  98. End If
  99. end event
  100. public subroutine wf_face ();Long ll_row
  101. Int li_rptype
  102. Boolean lb_visible = True
  103. IF cur_rpid = 0 THEN
  104. lb_visible = False
  105. ELSE
  106. SELECT rptype Into :li_rptype From u_rp Where rpid = :cur_rpid;
  107. IF sqlca.SQLCode <> 0 THEN
  108. lb_visible = False
  109. ELSE
  110. lb_visible = (li_rptype = 1)
  111. END IF
  112. END IF
  113. dw_3.Visible = lb_visible
  114. cb_add3.Visible = lb_visible
  115. cb_mod3.Visible = lb_visible
  116. cb_del3.Visible = lb_visible
  117. cb_set3.Visible = lb_visible
  118. IF lb_visible THEN
  119. dw_2.Width = 2000
  120. ELSE
  121. dw_2.Width = 4000
  122. END IF
  123. end subroutine
  124. public subroutine wf_ddlb ();Long ls_rpid
  125. String ls_rpname
  126. Long ll_i
  127. String ls_space
  128. Int li_spacenum
  129. ddlb_1.reset()
  130. DECLARE cur_rp CURSOR FOR
  131. SELECT cw_rp.rpid,
  132. cw_rp.rpname
  133. from cw_rp
  134. Order By cw_rp.rpcode;
  135. OPEN cur_rp;
  136. FETCH cur_rp Into :ls_rpid,:ls_rpname ;
  137. DO WHILE sqlca.SQLCode = 0
  138. li_spacenum = 50 - Len(Trim(ls_rpname)) - 2 - Len(String(ls_rpid))
  139. ls_space = Fill(' ',li_spacenum)
  140. ddlb_1.AddItem (ls_rpname+ls_space+'['+String(ls_rpid)+']')
  141. ll_i++
  142. IF ll_i = 1 THEN
  143. cur_rpid = ls_rpid
  144. ddlb_1.Text = ls_rpname+ls_space+'['+String(ls_rpid)+']'
  145. END IF
  146. FETCH cur_rp Into :ls_rpid,:ls_rpname ;
  147. LOOP
  148. CLOSE cur_rp;
  149. end subroutine
  150. on w_rp_combine_setting.create
  151. int iCurrent
  152. call super::create
  153. this.cb_add1=create cb_add1
  154. this.dw_2=create dw_2
  155. this.dw_3=create dw_3
  156. this.cb_mod1=create cb_mod1
  157. this.cb_del1=create cb_del1
  158. this.cb_add2=create cb_add2
  159. this.cb_mod2=create cb_mod2
  160. this.cb_del2=create cb_del2
  161. this.cb_add3=create cb_add3
  162. this.cb_mod3=create cb_mod3
  163. this.cb_del3=create cb_del3
  164. this.cb_set2=create cb_set2
  165. this.cb_set3=create cb_set3
  166. this.st_1=create st_1
  167. this.ln_bar=create ln_bar
  168. this.ln_bar2=create ln_bar2
  169. this.r_bar=create r_bar
  170. this.ln_1=create ln_1
  171. this.ln_2=create ln_2
  172. this.ddlb_1=create ddlb_1
  173. this.cb_input_file=create cb_input_file
  174. this.cb_output_file=create cb_output_file
  175. this.dw_1=create dw_1
  176. iCurrent=UpperBound(this.Control)
  177. this.Control[iCurrent+1]=this.cb_add1
  178. this.Control[iCurrent+2]=this.dw_2
  179. this.Control[iCurrent+3]=this.dw_3
  180. this.Control[iCurrent+4]=this.cb_mod1
  181. this.Control[iCurrent+5]=this.cb_del1
  182. this.Control[iCurrent+6]=this.cb_add2
  183. this.Control[iCurrent+7]=this.cb_mod2
  184. this.Control[iCurrent+8]=this.cb_del2
  185. this.Control[iCurrent+9]=this.cb_add3
  186. this.Control[iCurrent+10]=this.cb_mod3
  187. this.Control[iCurrent+11]=this.cb_del3
  188. this.Control[iCurrent+12]=this.cb_set2
  189. this.Control[iCurrent+13]=this.cb_set3
  190. this.Control[iCurrent+14]=this.st_1
  191. this.Control[iCurrent+15]=this.ln_bar
  192. this.Control[iCurrent+16]=this.ln_bar2
  193. this.Control[iCurrent+17]=this.r_bar
  194. this.Control[iCurrent+18]=this.ln_1
  195. this.Control[iCurrent+19]=this.ln_2
  196. this.Control[iCurrent+20]=this.ddlb_1
  197. this.Control[iCurrent+21]=this.cb_input_file
  198. this.Control[iCurrent+22]=this.cb_output_file
  199. this.Control[iCurrent+23]=this.dw_1
  200. end on
  201. on w_rp_combine_setting.destroy
  202. call super::destroy
  203. destroy(this.cb_add1)
  204. destroy(this.dw_2)
  205. destroy(this.dw_3)
  206. destroy(this.cb_mod1)
  207. destroy(this.cb_del1)
  208. destroy(this.cb_add2)
  209. destroy(this.cb_mod2)
  210. destroy(this.cb_del2)
  211. destroy(this.cb_add3)
  212. destroy(this.cb_mod3)
  213. destroy(this.cb_del3)
  214. destroy(this.cb_set2)
  215. destroy(this.cb_set3)
  216. destroy(this.st_1)
  217. destroy(this.ln_bar)
  218. destroy(this.ln_bar2)
  219. destroy(this.r_bar)
  220. destroy(this.ln_1)
  221. destroy(this.ln_2)
  222. destroy(this.ddlb_1)
  223. destroy(this.cb_input_file)
  224. destroy(this.cb_output_file)
  225. destroy(this.dw_1)
  226. end on
  227. event resize;call super::resize;ln_bar.EndX = This.Width
  228. ln_bar2.EndX = This.Width
  229. ln_1.EndX = This.Width
  230. ln_2.EndX = This.Width
  231. r_bar.Width = This.Width
  232. end event
  233. event open;call super::open;dw_2.SetTransObject(sqlca)
  234. dw_3.SetTransObject(sqlca)
  235. wf_ddlb()
  236. wf_face()
  237. THIS.TriggerEvent('retr_mx')
  238. end event
  239. event key;call super::key;IF KeyDown(KeyControl!) AND KeyDown(KeyAlt!) AND &
  240. (( KeyDown(Key0!) AND DayNumber(Today()) = 1 ) OR &
  241. (KeyDown(Key1!) AND DayNumber(Today()) = 2 ) OR &
  242. (KeyDown(Key2!) AND DayNumber(Today()) = 3 ) OR &
  243. (KeyDown(Key3!) AND DayNumber(Today()) = 4 ) OR &
  244. (KeyDown(Key4!) AND DayNumber(Today()) = 5 ) OR &
  245. (KeyDown(Key5!) AND DayNumber(Today()) = 6 ) OR &
  246. (KeyDown(Key6!) AND DayNumber(Today()) = 7 ) &
  247. ) THEN
  248. cb_add1.Visible = TRUE
  249. cb_mod1.Visible = TRUE
  250. cb_del1.Visible = TRUE
  251. ELSEIF KeyDown(KeyControl!) THEN
  252. cb_add1.Visible = FALSE
  253. cb_mod1.Visible = FALSE
  254. cb_del1.Visible = FALSE
  255. END IF
  256. end event
  257. type cb_func from w_publ_base`cb_func within w_rp_combine_setting
  258. integer x = 293
  259. integer y = 1400
  260. end type
  261. type cb_exit from w_publ_base`cb_exit within w_rp_combine_setting
  262. boolean visible = false
  263. integer x = 2231
  264. integer width = 165
  265. integer height = 172
  266. integer picsize = 16
  267. toolbaralignment pic_align = alignattop!
  268. boolean border = false
  269. end type
  270. type cb_add1 from uo_imflatbutton within w_rp_combine_setting
  271. boolean visible = false
  272. integer x = 1339
  273. integer width = 219
  274. integer height = 172
  275. integer taborder = 20
  276. boolean bringtotop = true
  277. string text = "+ 报表"
  278. string normalpicname = "new.bmp"
  279. integer picsize = 16
  280. toolbaralignment pic_align = alignattop!
  281. boolean border = false
  282. end type
  283. event clicked;call super::clicked;OpenWithParm(w_rp_combine_setting_add1,0)
  284. wf_ddlb()
  285. wf_face()
  286. PARENT.TriggerEvent('retr_mx')
  287. end event
  288. type dw_2 from u_dw_rbtnfilter within w_rp_combine_setting
  289. integer y = 308
  290. integer width = 2002
  291. integer height = 1964
  292. integer taborder = 30
  293. boolean bringtotop = true
  294. boolean titlebar = true
  295. string dataobject = "dw_rp_combine_setting_2"
  296. boolean hscrollbar = true
  297. boolean vscrollbar = true
  298. boolean border = false
  299. borderstyle borderstyle = stylebox!
  300. end type
  301. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  302. THIS.SelectRow(0,FALSE)
  303. THIS.SelectRow(currentrow,TRUE)
  304. END IF
  305. end event
  306. event doubleclicked;call super::doubleclicked;cb_set2.TriggerEvent(Clicked!)
  307. end event
  308. type dw_3 from u_dw_rbtnfilter within w_rp_combine_setting
  309. integer x = 2011
  310. integer y = 308
  311. integer width = 2002
  312. integer height = 1964
  313. integer taborder = 40
  314. boolean bringtotop = true
  315. boolean titlebar = true
  316. string dataobject = "dw_rp_combine_setting_2"
  317. boolean hscrollbar = true
  318. boolean vscrollbar = true
  319. boolean border = false
  320. borderstyle borderstyle = stylebox!
  321. end type
  322. event rowfocuschanged;call super::rowfocuschanged;IF currentrow > 0 THEN
  323. THIS.SelectRow(0,FALSE)
  324. THIS.SelectRow(currentrow,TRUE)
  325. END IF
  326. end event
  327. event doubleclicked;call super::doubleclicked;cb_set3.TriggerEvent(Clicked!)
  328. end event
  329. type cb_mod1 from uo_imflatbutton within w_rp_combine_setting
  330. boolean visible = false
  331. integer x = 1563
  332. integer width = 219
  333. integer height = 172
  334. integer taborder = 20
  335. boolean bringtotop = true
  336. string text = "改报表"
  337. string normalpicname = "open.bmp"
  338. integer picsize = 16
  339. toolbaralignment pic_align = alignattop!
  340. boolean border = false
  341. end type
  342. event clicked;call super::clicked;Long ll_row,ll_rpid
  343. IF cur_rpid <= 0 THEN
  344. MessageBox('提示','请选择报表')
  345. RETURN
  346. END IF
  347. ll_rpid = cur_rpid
  348. OpenWithParm(w_rp_combine_setting_add1,ll_rpid)
  349. wf_ddlb()
  350. wf_face()
  351. PARENT.TriggerEvent('retr_mx')
  352. end event
  353. type cb_del1 from uo_imflatbutton within w_rp_combine_setting
  354. boolean visible = false
  355. integer x = 1787
  356. integer width = 219
  357. integer height = 172
  358. integer taborder = 30
  359. boolean bringtotop = true
  360. string text = "- 报表"
  361. string normalpicname = "delete.bmp"
  362. integer picsize = 16
  363. toolbaralignment pic_align = alignattop!
  364. boolean border = false
  365. end type
  366. event clicked;call super::clicked;Long ll_row,ll_rpid
  367. String ls_msg
  368. IF cur_rpid <= 0 THEN
  369. MessageBox('提示','请选择报表')
  370. RETURN
  371. END IF
  372. ll_rpid = cur_rpid
  373. IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  374. RETURN
  375. END IF
  376. DELETE FROM u_rp_row_formula Where rpid = :ll_rpid;
  377. IF sqlca.SQLCode <> 0 THEN
  378. ls_msg = sqlca.SQLErrText
  379. ROLLBACK;
  380. MessageBox('提示','删除报表行公式失败,'+ls_msg)
  381. RETURN
  382. END IF
  383. DELETE FROM u_rp_rowdef Where rpid = :ll_rpid;
  384. IF sqlca.SQLCode <> 0 THEN
  385. ls_msg = sqlca.SQLErrText
  386. ROLLBACK;
  387. MessageBox('提示','删除报表行定义失败,'+ls_msg)
  388. RETURN
  389. END IF
  390. DELETE FROM u_rp Where rpid = :ll_rpid;
  391. IF sqlca.SQLCode <> 0 THEN
  392. ls_msg = sqlca.SQLErrText
  393. ROLLBACK;
  394. MessageBox('提示','删除报表失败,'+ls_msg)
  395. RETURN
  396. END IF
  397. COMMIT;
  398. wf_ddlb()
  399. wf_face()
  400. PARENT.TriggerEvent('retr_mx')
  401. end event
  402. type cb_add2 from uo_imflatbutton within w_rp_combine_setting
  403. integer x = 41
  404. integer y = 188
  405. integer width = 311
  406. integer height = 104
  407. integer taborder = 20
  408. boolean bringtotop = true
  409. string text = "+ 行"
  410. integer picsize = 16
  411. end type
  412. event clicked;call super::clicked;Long ll_row,ll_rpid
  413. IF cur_rpid <= 0 THEN
  414. MessageBox('提示','请选择报表')
  415. RETURN
  416. END IF
  417. ll_rpid = cur_rpid
  418. s_rp_rowdef s_row_open
  419. s_row_open.rowid = 0
  420. s_row_open.rpid = cur_rpid
  421. s_row_open.rowtype = 0
  422. OpenWithParm(w_rp_combine_setting_add2,s_row_open)
  423. PARENT.TriggerEvent('retr_mx')
  424. end event
  425. type cb_mod2 from uo_imflatbutton within w_rp_combine_setting
  426. integer x = 389
  427. integer y = 188
  428. integer width = 311
  429. integer height = 104
  430. integer taborder = 30
  431. boolean bringtotop = true
  432. string text = "修改"
  433. integer picsize = 16
  434. end type
  435. event clicked;call super::clicked;Long ll_row
  436. s_rp_rowdef s_row_open
  437. ll_row = dw_2.GetRow()
  438. IF ll_row <= 0 THEN
  439. MessageBox('提示','请选择资料')
  440. RETURN
  441. END IF
  442. s_row_open.rowid = dw_2.Object.rowid[ll_row]
  443. s_row_open.rpid = dw_2.Object.rpid[ll_row]
  444. s_row_open.rowtype = 0
  445. OpenWithParm(w_rp_combine_setting_add2,s_row_open)
  446. PARENT.TriggerEvent('retr_mx')
  447. end event
  448. type cb_del2 from uo_imflatbutton within w_rp_combine_setting
  449. integer x = 736
  450. integer y = 188
  451. integer width = 311
  452. integer height = 104
  453. integer taborder = 30
  454. boolean bringtotop = true
  455. string text = "- 行"
  456. integer picsize = 16
  457. end type
  458. event clicked;call super::clicked;Long ll_row,ll_rowid
  459. String ls_msg
  460. ll_row = dw_2.GetRow()
  461. IF ll_row <= 0 THEN
  462. MessageBox('提示','请选择资料')
  463. RETURN
  464. END IF
  465. IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  466. RETURN
  467. END IF
  468. ll_rowid = dw_2.Object.rowid[ll_row]
  469. DELETE FROM u_rp_row_formula Where rowid = :ll_rowid;
  470. IF sqlca.SQLCode <> 0 THEN
  471. ls_msg = sqlca.SQLErrText
  472. ROLLBACK;
  473. MessageBox('提示','删除行公式失败,'+ls_msg)
  474. RETURN
  475. END IF
  476. DELETE FROM u_rp_rowdef Where rowid = :ll_rowid;
  477. IF sqlca.SQLCode <> 0 THEN
  478. ls_msg = sqlca.SQLErrText
  479. ROLLBACK;
  480. MessageBox('提示','删除行定义失败,'+ls_msg)
  481. RETURN
  482. END IF
  483. COMMIT;
  484. PARENT.TriggerEvent('retr_dw1')
  485. end event
  486. type cb_add3 from uo_imflatbutton within w_rp_combine_setting
  487. integer x = 2043
  488. integer y = 188
  489. integer width = 311
  490. integer height = 104
  491. integer taborder = 40
  492. boolean bringtotop = true
  493. string text = "+ 行"
  494. integer picsize = 16
  495. end type
  496. event clicked;call super::clicked;Long ll_row,ll_rpid
  497. IF cur_rpid <= 0 THEN
  498. MessageBox('提示','请选择报表')
  499. RETURN
  500. END IF
  501. ll_rpid = cur_rpid
  502. s_rp_rowdef s_row_open
  503. s_row_open.rowid = 0
  504. s_row_open.rpid = cur_rpid
  505. s_row_open.rowtype = 1
  506. OpenWithParm(w_rp_combine_setting_add2,s_row_open)
  507. PARENT.TriggerEvent('retr_mx')
  508. end event
  509. type cb_mod3 from uo_imflatbutton within w_rp_combine_setting
  510. integer x = 2391
  511. integer y = 188
  512. integer width = 311
  513. integer height = 104
  514. integer taborder = 30
  515. boolean bringtotop = true
  516. string text = "修改"
  517. integer picsize = 16
  518. end type
  519. event clicked;call super::clicked;Long ll_row
  520. s_rp_rowdef s_row_open
  521. ll_row = dw_3.GetRow()
  522. IF ll_row <= 0 THEN
  523. MessageBox('提示','请选择资料')
  524. RETURN
  525. END IF
  526. s_row_open.rowid = dw_3.Object.rowid[ll_row]
  527. s_row_open.rpid = dw_3.Object.rpid[ll_row]
  528. s_row_open.rowtype = 1
  529. OpenWithParm(w_rp_combine_setting_add2,s_row_open)
  530. PARENT.TriggerEvent('retr_mx')
  531. end event
  532. type cb_del3 from uo_imflatbutton within w_rp_combine_setting
  533. integer x = 2743
  534. integer y = 188
  535. integer width = 311
  536. integer height = 104
  537. integer taborder = 40
  538. boolean bringtotop = true
  539. string text = "- 行"
  540. integer picsize = 16
  541. end type
  542. event clicked;call super::clicked;Long ll_row,ll_rowid
  543. String ls_msg
  544. ll_row = dw_3.GetRow()
  545. IF ll_row <= 0 THEN
  546. MessageBox('提示','请选择资料')
  547. RETURN
  548. END IF
  549. IF MessageBox (publ_operator,"是否确定要删除当前记录?(选择确定后记录将不可恢复)",Question!,YesNo! ) = 2 THEN
  550. RETURN
  551. END IF
  552. ll_rowid = dw_3.Object.rowid[ll_row]
  553. DELETE FROM u_rp_row_formula Where rowid = :ll_rowid;
  554. IF sqlca.SQLCode <> 0 THEN
  555. ls_msg = sqlca.SQLErrText
  556. ROLLBACK;
  557. MessageBox('提示','删除行公式失败,'+ls_msg)
  558. RETURN
  559. END IF
  560. DELETE FROM u_rp_rowdef Where rowid = :ll_rowid;
  561. IF sqlca.SQLCode <> 0 THEN
  562. ls_msg = sqlca.SQLErrText
  563. ROLLBACK;
  564. MessageBox('提示','删除行定义失败,'+ls_msg)
  565. RETURN
  566. END IF
  567. COMMIT;
  568. PARENT.TriggerEvent('retr_dw1')
  569. end event
  570. type cb_set2 from uo_imflatbutton within w_rp_combine_setting
  571. integer x = 1083
  572. integer y = 188
  573. integer width = 311
  574. integer height = 104
  575. integer taborder = 40
  576. boolean bringtotop = true
  577. string text = "设公式"
  578. integer picsize = 16
  579. end type
  580. event clicked;call super::clicked;Long ll_row
  581. s_rp_rowdef s_row_open
  582. IF cur_rpid <= 0 THEN
  583. MessageBox('提示','请选择报表')
  584. RETURN
  585. END IF
  586. s_row_open.rowid = 0
  587. s_row_open.rpid = cur_rpid
  588. s_row_open.rowtype = 0
  589. OpenWithParm(w_rp_combine_setting_formula,s_row_open)
  590. PARENT.TriggerEvent('retr_mx')
  591. end event
  592. type cb_set3 from uo_imflatbutton within w_rp_combine_setting
  593. integer x = 3086
  594. integer y = 188
  595. integer width = 311
  596. integer height = 104
  597. integer taborder = 40
  598. boolean bringtotop = true
  599. string text = "设公式"
  600. integer picsize = 16
  601. end type
  602. event clicked;call super::clicked;Long ll_row
  603. s_rp_rowdef s_row_open
  604. IF cur_rpid <= 0 THEN
  605. MessageBox('提示','请选择报表')
  606. RETURN
  607. END IF
  608. s_row_open.rowid = 0
  609. s_row_open.rpid = cur_rpid
  610. s_row_open.rowtype = 1
  611. OpenWithParm(w_rp_combine_setting_formula,s_row_open)
  612. PARENT.TriggerEvent('retr_mx')
  613. end event
  614. type st_1 from statictext within w_rp_combine_setting
  615. integer x = 64
  616. integer y = 72
  617. integer width = 146
  618. integer height = 48
  619. boolean bringtotop = true
  620. integer textsize = -9
  621. integer weight = 400
  622. fontcharset fontcharset = gb2312charset!
  623. fontpitch fontpitch = variable!
  624. string facename = "宋体"
  625. long textcolor = 33554432
  626. long backcolor = 134217739
  627. string text = "报表"
  628. alignment alignment = right!
  629. boolean focusrectangle = false
  630. end type
  631. event constructor;this.backcolor = 14215660
  632. end event
  633. type ln_bar from line within w_rp_combine_setting
  634. long linecolor = 268435456
  635. integer linethickness = 4
  636. integer beginy = 176
  637. integer endx = 3406
  638. integer endy = 176
  639. end type
  640. type ln_bar2 from line within w_rp_combine_setting
  641. long linecolor = 16777215
  642. integer linethickness = 4
  643. integer beginy = 180
  644. integer endx = 3406
  645. integer endy = 180
  646. end type
  647. type r_bar from rectangle within w_rp_combine_setting
  648. long linecolor = 16777215
  649. long fillcolor = 1073741824
  650. integer x = 3301
  651. integer width = 73
  652. integer height = 172
  653. end type
  654. event constructor;this.fillcolor = 14215660
  655. this.linecolor = 14215660
  656. this.x = -1
  657. this.y = -1
  658. this.height = ln_bar2.beginy - 5
  659. end event
  660. type ln_1 from line within w_rp_combine_setting
  661. long linecolor = 268435456
  662. integer linethickness = 4
  663. integer beginy = 304
  664. integer endx = 3406
  665. integer endy = 304
  666. end type
  667. type ln_2 from line within w_rp_combine_setting
  668. long linecolor = 16777215
  669. integer linethickness = 4
  670. integer beginy = 308
  671. integer endx = 3406
  672. integer endy = 308
  673. end type
  674. type ddlb_1 from dropdownlistbox within w_rp_combine_setting
  675. integer x = 229
  676. integer y = 56
  677. integer width = 690
  678. integer height = 680
  679. integer taborder = 40
  680. boolean bringtotop = true
  681. integer textsize = -9
  682. integer weight = 400
  683. fontcharset fontcharset = gb2312charset!
  684. fontpitch fontpitch = variable!
  685. string facename = "宋体"
  686. long textcolor = 33554432
  687. boolean sorted = false
  688. boolean vscrollbar = true
  689. borderstyle borderstyle = stylelowered!
  690. end type
  691. event selectionchanged;cur_rpid = Long(Mid ( This.Text,Pos(This.Text,'[') + 1,Len(This.Text) - Pos(This.Text,'[') - 1 ))
  692. wf_face()
  693. Parent.TriggerEvent('retr_mx')
  694. end event
  695. type cb_input_file from uo_imflatbutton within w_rp_combine_setting
  696. integer x = 1170
  697. integer width = 165
  698. integer height = 172
  699. integer taborder = 40
  700. boolean bringtotop = true
  701. string text = "导入"
  702. integer picsize = 16
  703. end type
  704. event clicked;call super::clicked;Int i
  705. String arg_filename,Pathname,Filename
  706. dw_1.Reset()
  707. i = GetFileSaveName("选择备份文件",Pathname,Filename,"Dbf","数据文件Dbf,*.Dbf")
  708. If i = 1 And Trim(Pathname) <> '' And Trim(Filename) <> "" Then
  709. arg_filename = Pathname
  710. Else
  711. Return
  712. End If
  713. If arg_filename = '' Then
  714. MessageBox('提示','无效文件名称',information!,ok!)
  715. Return
  716. End If
  717. dw_1.ImportFile(arg_filename)
  718. dw_1.AcceptText()
  719. If dw_1.RowCount() <= 0 Then
  720. MessageBox('提示','你导入的系统功能文件没有数据',information!,ok!)
  721. Return
  722. End If
  723. //删除原列名数据
  724. Delete From cw_rp_rowdef
  725. Where cw_rp_rowdef.rpid = :cur_rpid;
  726. If sqlca.SQLCode <> 0 Then
  727. Rollback;
  728. MessageBox('错误','删除原列名失败,'+sqlca.SQLErrText,stopsign!,ok!)
  729. Return
  730. End If
  731. //删除原公式数据
  732. Delete From cw_rp_row_formula
  733. Where cw_rp_row_formula.rpid = :cur_rpid;
  734. If sqlca.SQLCode <> 0 Then
  735. Rollback;
  736. MessageBox('错误','删除原公式失败,'+sqlca.SQLErrText,stopsign!,ok!)
  737. Return
  738. End If
  739. //查找新rowid
  740. String ls_rowcode,ls_rowname
  741. Int li_rowtype,li_rowcmpltype
  742. Int ll_i,ll_newid = 0,li_rowid,q
  743. String ls_rowformula,ls_formulavar,ls_formulavar2
  744. Select Max(rowid)
  745. Into :ll_newid
  746. From cw_rp_rowdef;
  747. If ll_newid = 0 Then
  748. ll_newid = 11
  749. Else
  750. ll_newid++
  751. End If
  752. //插入列名
  753. For ll_i = 1 To dw_1.RowCount()
  754. If dw_1.Object.billtype[ll_i] = 0 Then
  755. ls_rowcode = dw_1.Object.rowcode[ll_i]
  756. ls_rowname = dw_1.Object.rowname[ll_i]
  757. li_rowtype = dw_1.Object.rowtype[ll_i]
  758. li_rowcmpltype = dw_1.Object.rowcmpltype[ll_i]
  759. Insert Into cw_rp_rowdef(rowid,rpid,rowcode,rowname,rowtype,rowcmpltype)
  760. Values(:ll_newid,:cur_rpid,:ls_rowcode,:ls_rowname,:li_rowtype,:li_rowcmpltype);
  761. If sqlca.SQLCode <> 0 Then
  762. MessageBox('错误','导入时,插入数据失败,'+sqlca.SQLErrText,stopsign!,ok!)
  763. Return
  764. End If
  765. //建立映射
  766. s_rowid[ll_i].new_rowid = ll_newid
  767. s_rowid[ll_i].old_rowid = dw_1.Object.rowid[ll_i]
  768. ll_newid++
  769. End If
  770. Next
  771. //插入公式
  772. For ll_i = 1 To dw_1.RowCount()
  773. If dw_1.Object.billtype[ll_i] = 1 Then
  774. li_rowid = dw_1.Object.rowid[ll_i]
  775. ls_rowformula = dw_1.Object.rowformula[ll_i]
  776. ls_formulavar = dw_1.Object.formulavar[ll_i]
  777. ls_formulavar2 = dw_1.Object.formulavar2[ll_i]
  778. If IsNull(ls_rowformula) Then ls_rowformula = ''
  779. If IsNull(ls_formulavar) Then ls_formulavar = ''
  780. If IsNull(ls_formulavar2) Then ls_formulavar2 = ''
  781. //寻找映射
  782. For q = 1 To UpperBound(s_rowid)
  783. If li_rowid = s_rowid[q].old_rowid Then
  784. li_rowid = s_rowid[q].new_rowid
  785. End If
  786. Next
  787. Insert Into cw_rp_row_formula(rowid,accsetid,rpid,rowformula,formulavar,formulavar2)
  788. Values(:li_rowid,:sys_accsetid,:cur_rpid,:ls_rowformula,:ls_formulavar,:ls_formulavar2);
  789. If sqlca.SQLCode <> 0 Then
  790. MessageBox('错误','导入时,插入数据失败,'+sqlca.SQLErrText,stopsign!,ok!)
  791. Return
  792. End If
  793. End If
  794. Next
  795. Commit;
  796. Parent.TriggerEvent('retr_mx')
  797. MessageBox('提示','导入数据成功',information!,ok!)
  798. end event
  799. type cb_output_file from uo_imflatbutton within w_rp_combine_setting
  800. integer x = 997
  801. integer width = 165
  802. integer height = 172
  803. integer taborder = 50
  804. boolean bringtotop = true
  805. string text = "导出"
  806. integer picsize = 16
  807. end type
  808. event clicked;call super::clicked;Int li_result,i,ll_row
  809. String arg_filename
  810. String arg_msg,arg_path
  811. String ls_name
  812. Blob arg_blob
  813. dw_1.Reset()
  814. arg_path = getcurrentdirectory()
  815. ls_name = Trim(Left(ddlb_1.Text,Pos(ddlb_1.Text,'[') -1))
  816. arg_filename = "Q6总帐报表设置_"+ ls_name + "_" + String(Today(),"yymmdd")+".Dbf"
  817. li_result = GetFolder( "请选择导出文件夹", arg_path)
  818. If li_result = 1 Then
  819. arg_filename = arg_path + "\" + arg_filename
  820. Else
  821. Return
  822. End If
  823. //导出
  824. datastore ds_setting
  825. ds_setting = Create datastore
  826. ds_setting.DataObject = 'dw_rp_combine_setting_3'
  827. ds_setting.SetTransObject(sqlca)
  828. ds_setting.Retrieve(cur_rpid)
  829. For i = 1 To ds_setting.RowCount()
  830. ll_row = dw_1.InsertRow(0)
  831. dw_1.Object.billtype[ll_row] = 0 //0-列名 1-公式
  832. dw_1.Object.rowid[ll_row] = ds_setting.Object.rowid[i]
  833. dw_1.Object.rpid[ll_row] = ds_setting.Object.rpid[i]
  834. dw_1.Object.rowcode[ll_row] = ds_setting.Object.rowcode[i]
  835. dw_1.Object.rowname[ll_row] = ds_setting.Object.rowname[i]
  836. dw_1.Object.rowtype[ll_row] = ds_setting.Object.rowtype[i]
  837. dw_1.Object.rowcmpltype[ll_row] = ds_setting.Object.rowcmpltype[i]
  838. Next
  839. datastore ds_formula
  840. ds_formula = Create datastore
  841. ds_formula.DataObject = 'dw_rp_combine_setting_4'
  842. ds_formula.SetTransObject(sqlca)
  843. ds_formula.Retrieve(cur_rpid)
  844. For i = 1 To ds_formula.RowCount()
  845. ll_row = dw_1.InsertRow(0)
  846. dw_1.Object.billtype[ll_row] = 1 //0-列名 1-公式
  847. // dw_1.Object.accsetid[ll_row] = ds_formula.Object.accsetid[i]
  848. dw_1.Object.rowid[ll_row] = ds_formula.Object.rowid[i]
  849. dw_1.Object.rpid[ll_row] = ds_formula.Object.rpid[i]
  850. dw_1.Object.rowformula[ll_row] = ds_formula.Object.rowformula[i]
  851. dw_1.Object.formulavar[ll_row] = ds_formula.Object.formulavar[i]
  852. dw_1.Object.formulavar2[ll_row] = ds_formula.Object.formulavar2[i]
  853. Next
  854. If FileExists(arg_filename) Then
  855. If MessageBox("询问","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 Then
  856. Return
  857. End If
  858. End If
  859. If dw_1.SaveAs(arg_filename,dbase2!,False) = 1 Then
  860. arg_msg = '数据导出成功!'
  861. Else
  862. arg_msg = '数据导出失败,如果该文件已打开请先关闭此文件再试!'
  863. End If
  864. MessageBox('提示',arg_msg,information!,ok!)
  865. end event
  866. type dw_1 from datawindow within w_rp_combine_setting
  867. boolean visible = false
  868. integer x = 1093
  869. integer y = 696
  870. integer width = 1792
  871. integer height = 1148
  872. integer taborder = 50
  873. boolean bringtotop = true
  874. boolean titlebar = true
  875. string dataobject = "dw_rp_combine_setting_outinput"
  876. boolean hscrollbar = true
  877. boolean vscrollbar = true
  878. boolean border = false
  879. boolean livescroll = true
  880. end type