w_rpt_imexport_field.srw 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. $PBExportHeader$w_rpt_imexport_field.srw
  2. forward
  3. global type w_rpt_imexport_field from w_publ_base
  4. end type
  5. type sle_filename from singlelineedit within w_rpt_imexport_field
  6. end type
  7. type cb_1 from uo_imflatbutton within w_rpt_imexport_field
  8. end type
  9. type cb_import from uo_imflatbutton within w_rpt_imexport_field
  10. end type
  11. type cb_export from uo_imflatbutton within w_rpt_imexport_field
  12. end type
  13. type sle_filename1 from singlelineedit within w_rpt_imexport_field
  14. end type
  15. type cb_2 from uo_imflatbutton within w_rpt_imexport_field
  16. end type
  17. type gb_1 from groupbox within w_rpt_imexport_field
  18. end type
  19. type gb_2 from groupbox within w_rpt_imexport_field
  20. end type
  21. end forward
  22. global type w_rpt_imexport_field from w_publ_base
  23. integer width = 2235
  24. integer height = 760
  25. string title = "龙嘉导入导出单据列表"
  26. boolean minbox = false
  27. windowtype windowtype = response!
  28. long backcolor = 67108864
  29. sle_filename sle_filename
  30. cb_1 cb_1
  31. cb_import cb_import
  32. cb_export cb_export
  33. sle_filename1 sle_filename1
  34. cb_2 cb_2
  35. gb_1 gb_1
  36. gb_2 gb_2
  37. end type
  38. global w_rpt_imexport_field w_rpt_imexport_field
  39. type variables
  40. end variables
  41. on w_rpt_imexport_field.create
  42. int iCurrent
  43. call super::create
  44. this.sle_filename=create sle_filename
  45. this.cb_1=create cb_1
  46. this.cb_import=create cb_import
  47. this.cb_export=create cb_export
  48. this.sle_filename1=create sle_filename1
  49. this.cb_2=create cb_2
  50. this.gb_1=create gb_1
  51. this.gb_2=create gb_2
  52. iCurrent=UpperBound(this.Control)
  53. this.Control[iCurrent+1]=this.sle_filename
  54. this.Control[iCurrent+2]=this.cb_1
  55. this.Control[iCurrent+3]=this.cb_import
  56. this.Control[iCurrent+4]=this.cb_export
  57. this.Control[iCurrent+5]=this.sle_filename1
  58. this.Control[iCurrent+6]=this.cb_2
  59. this.Control[iCurrent+7]=this.gb_1
  60. this.Control[iCurrent+8]=this.gb_2
  61. end on
  62. on w_rpt_imexport_field.destroy
  63. call super::destroy
  64. destroy(this.sle_filename)
  65. destroy(this.cb_1)
  66. destroy(this.cb_import)
  67. destroy(this.cb_export)
  68. destroy(this.sle_filename1)
  69. destroy(this.cb_2)
  70. destroy(this.gb_1)
  71. destroy(this.gb_2)
  72. end on
  73. type cb_func from w_publ_base`cb_func within w_rpt_imexport_field
  74. boolean visible = false
  75. end type
  76. type cb_exit from w_publ_base`cb_exit within w_rpt_imexport_field
  77. integer x = 1824
  78. integer y = 552
  79. integer width = 325
  80. end type
  81. type sle_filename from singlelineedit within w_rpt_imexport_field
  82. integer x = 91
  83. integer y = 116
  84. integer width = 1586
  85. integer height = 92
  86. integer taborder = 30
  87. boolean bringtotop = true
  88. integer textsize = -9
  89. integer weight = 400
  90. fontcharset fontcharset = gb2312charset!
  91. fontpitch fontpitch = variable!
  92. string facename = "宋体"
  93. long textcolor = 33554432
  94. borderstyle borderstyle = stylelowered!
  95. end type
  96. type cb_1 from uo_imflatbutton within w_rpt_imexport_field
  97. integer x = 1701
  98. integer y = 116
  99. integer width = 114
  100. integer height = 96
  101. integer taborder = 40
  102. boolean bringtotop = true
  103. string text = "..."
  104. end type
  105. event clicked;call super::clicked;
  106. integer i
  107. string pathname
  108. string filename
  109. i = getfilesavename("选择文件",pathname,filename,"Dbf","数据文件Dbf,*.Dbf")
  110. if i = 1 and trim(pathname) <> "" and trim(filename) <> "" then
  111. parent.sle_filename.text = pathname
  112. end if
  113. return
  114. end event
  115. type cb_import from uo_imflatbutton within w_rpt_imexport_field
  116. integer x = 1815
  117. integer y = 116
  118. integer width = 325
  119. integer height = 96
  120. integer taborder = 40
  121. boolean bringtotop = true
  122. string text = "导入"
  123. end type
  124. event clicked;call super::clicked;Long ll_i
  125. IF NOT sys_power_issuper THEN
  126. MessageBox('提示','你没有使用权限!',information!,OK!)
  127. RETURN
  128. END IF
  129. datastore ds_field
  130. String arg_filename
  131. arg_filename = Trim(sle_filename.Text)
  132. IF arg_filename = '' THEN
  133. MessageBox('提示','请输入文件名称',information!,OK!)
  134. RETURN
  135. END IF
  136. ds_field = CREATE datastore
  137. ds_field.DataObject = 'dw_rpt_field_def'
  138. ds_field.SetTransObject(sqlca)
  139. ds_field.ImportFile(arg_filename)
  140. ds_field.AcceptText()
  141. IF ds_field.RowCount() <= 0 THEN
  142. MessageBox('提示','你导入的字段列表文件没有数据',information!,OK!)
  143. RETURN
  144. END IF
  145. DELETE FROM pbcatcol;
  146. IF sqlca.SQLCode <> 0 THEN
  147. MessageBox('错误','删除原字段列表数据失败,'+sqlca.SQLErrText,stopsign!,OK!)
  148. RETURN
  149. END IF
  150. Int pbc_tid ,pbc_cid,pbc_lpos,pbc_hpos
  151. String pbc_ownr,pbc_cnam,pbc_labl,pbc_hdr,pbc_tnam
  152. Int pbc_jtfy
  153. String pbc_mask
  154. Int pbc_case
  155. Int pbc_hght
  156. Int pbc_wdth
  157. String pbc_ptrn
  158. String pbc_bmap
  159. String pbc_init
  160. String pbc_cmnt
  161. String pbc_edit
  162. String pbc_tag
  163. FOR ll_i = 1 TO ds_field.RowCount()
  164. pbc_tnam = ds_field.Object.pbc_tnam[ll_i]
  165. pbc_tid = ds_field.Object.pbc_tid[ll_i]
  166. pbc_cid = ds_field.Object.pbc_cid[ll_i]
  167. pbc_lpos = ds_field.Object.pbc_lpos[ll_i]
  168. pbc_hpos = ds_field.Object.pbc_hpos[ll_i]
  169. pbc_ownr = ds_field.Object.pbc_ownr[ll_i]
  170. pbc_cnam = ds_field.Object.pbc_cnam[ll_i]
  171. pbc_labl = ds_field.Object.pbc_labl[ll_i]
  172. pbc_hdr = ds_field.Object.pbc_hdr[ll_i]
  173. pbc_jtfy = ds_field.Object.pbc_jtfy[ll_i]
  174. pbc_mask = ds_field.Object.pbc_mask[ll_i]
  175. pbc_case = ds_field.Object.pbc_case[ll_i]
  176. pbc_hght = ds_field.Object.pbc_hght[ll_i]
  177. pbc_wdth = ds_field.Object.pbc_wdth[ll_i]
  178. pbc_ptrn = ds_field.Object.pbc_ptrn[ll_i]
  179. pbc_bmap = ds_field.Object.pbc_bmap[ll_i]
  180. pbc_init = ds_field.Object.pbc_init[ll_i]
  181. pbc_cmnt = ds_field.Object.pbc_cmnt[ll_i]
  182. pbc_edit = ds_field.Object.pbc_edit[ll_i]
  183. pbc_tag = ds_field.Object.pbc_tag[ll_i]
  184. INSERT INTO pbcatcol(
  185. pbc_tnam ,
  186. pbc_tid ,
  187. pbc_cid,
  188. pbc_lpos,
  189. pbc_hpos,
  190. pbc_ownr,
  191. pbc_cnam,
  192. pbc_labl,
  193. pbc_hdr ,
  194. pbc_jtfy ,
  195. pbc_mask,
  196. pbc_case ,
  197. pbc_hght ,
  198. pbc_wdth ,
  199. pbc_ptrn ,
  200. pbc_bmap,
  201. pbc_init,
  202. pbc_cmnt,
  203. pbc_edit,
  204. pbc_tag
  205. )
  206. VALUES(
  207. :pbc_tnam ,
  208. :pbc_tid ,
  209. :pbc_cid,
  210. :pbc_lpos,
  211. :pbc_hpos,
  212. :pbc_ownr,
  213. :pbc_cnam,
  214. :pbc_labl,
  215. :pbc_hdr ,
  216. :pbc_jtfy ,
  217. :pbc_mask,
  218. :pbc_case ,
  219. :pbc_hght ,
  220. :pbc_wdth ,
  221. :pbc_ptrn ,
  222. :pbc_bmap,
  223. :pbc_init,
  224. :pbc_cmnt,
  225. :pbc_edit,
  226. :pbc_tag);
  227. IF sqlca.SQLCode <> 0 THEN
  228. MessageBox('错误','导入字段列表数据失败,'+sqlca.SQLErrText,stopsign!,OK!)
  229. RETURN
  230. END IF
  231. NEXT
  232. COMMIT;
  233. MessageBox('提示','导入字段列表数据成功',information!,OK!)
  234. end event
  235. type cb_export from uo_imflatbutton within w_rpt_imexport_field
  236. integer x = 1815
  237. integer y = 368
  238. integer width = 325
  239. integer height = 96
  240. integer taborder = 40
  241. boolean bringtotop = true
  242. string text = "导出"
  243. end type
  244. event clicked;call super::clicked;
  245. string arg_filename,arg_msg
  246. blob arg_blob
  247. arg_filename = trim(sle_filename1.text)
  248. if arg_filename = '' then
  249. messagebox('提示','请输入文件名称',information!,OK!)
  250. return
  251. end if
  252. if messagebox("询问","是否确定要将字段列表导出成文件",question!,yesno!,1) = 2 then
  253. return
  254. end if
  255. datastore ds_field
  256. ds_field = create datastore
  257. ds_field.dataobject = 'dw_rpt_field_def'
  258. ds_field.settransobject(sqlca)
  259. ds_field.retrieve('-1')
  260. if fileexists(arg_filename) then
  261. if messagebox("询问","指定文件已经存在,是否覆盖该文件?",question!,yesno!,2) = 2 then
  262. return
  263. end if
  264. end if
  265. if ds_field.saveas(arg_filename,dBASE3!,false) = 1 then
  266. arg_msg = '数据导出成功!'
  267. else
  268. arg_msg = '数据导出失败,如果该文件已打开请先关闭此文件再试!'
  269. end if
  270. messagebox('提示',arg_msg,information!,OK!)
  271. end event
  272. type sle_filename1 from singlelineedit within w_rpt_imexport_field
  273. integer x = 91
  274. integer y = 368
  275. integer width = 1586
  276. integer height = 92
  277. integer taborder = 40
  278. boolean bringtotop = true
  279. integer textsize = -9
  280. integer weight = 400
  281. fontcharset fontcharset = gb2312charset!
  282. fontpitch fontpitch = variable!
  283. string facename = "宋体"
  284. long textcolor = 33554432
  285. borderstyle borderstyle = stylelowered!
  286. end type
  287. type cb_2 from uo_imflatbutton within w_rpt_imexport_field
  288. integer x = 1701
  289. integer y = 368
  290. integer width = 114
  291. integer height = 96
  292. integer taborder = 50
  293. boolean bringtotop = true
  294. string text = "..."
  295. end type
  296. event clicked;call super::clicked;
  297. integer i
  298. string pathname
  299. string filename
  300. i = getfilesavename("选择文件",pathname,filename,"Dbf","数据文件Dbf,*.Dbf")
  301. if i = 1 and trim(pathname) <> "" and trim(filename) <> "" then
  302. parent.sle_filename1.text = pathname
  303. end if
  304. return
  305. end event
  306. type gb_1 from groupbox within w_rpt_imexport_field
  307. integer x = 59
  308. integer y = 48
  309. integer width = 2107
  310. integer height = 216
  311. integer taborder = 10
  312. integer textsize = -9
  313. integer weight = 400
  314. fontcharset fontcharset = gb2312charset!
  315. fontpitch fontpitch = variable!
  316. string facename = "宋体"
  317. long textcolor = 33554432
  318. long backcolor = 79741120
  319. string text = "导入文件路径"
  320. end type
  321. type gb_2 from groupbox within w_rpt_imexport_field
  322. integer x = 59
  323. integer y = 300
  324. integer width = 2107
  325. integer height = 216
  326. integer taborder = 20
  327. integer textsize = -9
  328. integer weight = 400
  329. fontcharset fontcharset = gb2312charset!
  330. fontpitch fontpitch = variable!
  331. string facename = "宋体"
  332. long textcolor = 33554432
  333. long backcolor = 79741120
  334. string text = "导出文件路径"
  335. end type