w_rpt_sentdataout.srw 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260
  1. $PBExportHeader$w_rpt_sentdataout.srw
  2. $PBExportComments$数据发送窗口
  3. forward
  4. global type w_rpt_sentdataout from w_rpt_publ_base
  5. end type
  6. type cb_backup from uo_imflatbutton within w_rpt_sentdataout
  7. end type
  8. type st_1 from statictext within w_rpt_sentdataout
  9. end type
  10. type sle_filename from singlelineedit within w_rpt_sentdataout
  11. end type
  12. type cb_ch from commandbutton within w_rpt_sentdataout
  13. end type
  14. type gb_1 from groupbox within w_rpt_sentdataout
  15. end type
  16. type ddlb_dataformat from dropdownlistbox within w_rpt_sentdataout
  17. end type
  18. end forward
  19. global type w_rpt_sentdataout from w_rpt_publ_base
  20. integer width = 1883
  21. integer height = 628
  22. string title = "龙嘉数据发送"
  23. boolean minbox = false
  24. windowtype windowtype = response!
  25. cb_backup cb_backup
  26. st_1 st_1
  27. sle_filename sle_filename
  28. cb_ch cb_ch
  29. gb_1 gb_1
  30. ddlb_dataformat ddlb_dataformat
  31. end type
  32. global w_rpt_sentdataout w_rpt_sentdataout
  33. type variables
  34. DATAWINDOW OBJ_DW
  35. INT ddlb_dataformat_INDEX=1
  36. end variables
  37. on w_rpt_sentdataout.create
  38. int iCurrent
  39. call super::create
  40. this.cb_backup=create cb_backup
  41. this.st_1=create st_1
  42. this.sle_filename=create sle_filename
  43. this.cb_ch=create cb_ch
  44. this.gb_1=create gb_1
  45. this.ddlb_dataformat=create ddlb_dataformat
  46. iCurrent=UpperBound(this.Control)
  47. this.Control[iCurrent+1]=this.cb_backup
  48. this.Control[iCurrent+2]=this.st_1
  49. this.Control[iCurrent+3]=this.sle_filename
  50. this.Control[iCurrent+4]=this.cb_ch
  51. this.Control[iCurrent+5]=this.gb_1
  52. this.Control[iCurrent+6]=this.ddlb_dataformat
  53. end on
  54. on w_rpt_sentdataout.destroy
  55. call super::destroy
  56. destroy(this.cb_backup)
  57. destroy(this.st_1)
  58. destroy(this.sle_filename)
  59. destroy(this.cb_ch)
  60. destroy(this.gb_1)
  61. destroy(this.ddlb_dataformat)
  62. end on
  63. event open;call super::open;OBJ_DW=Message.PowerObjectParm
  64. //IF OBJ_DW.DATAOBJECT='' THEN CLOSE(THIS)
  65. end event
  66. type cb_exit from w_rpt_publ_base`cb_exit within w_rpt_sentdataout
  67. integer x = 1138
  68. integer y = 388
  69. integer width = 320
  70. end type
  71. type cb_backup from uo_imflatbutton within w_rpt_sentdataout
  72. integer x = 453
  73. integer y = 388
  74. integer width = 320
  75. integer height = 96
  76. integer taborder = 60
  77. string text = "发送"
  78. end type
  79. event clicked;call super::clicked;if not f_power_ind(126) then
  80. messagebox(publ_operator,'你没有使用权限!')
  81. return
  82. end if
  83. integer SAVE_RSLT=0
  84. IF ddlb_dataformat_INDEX<>4 AND LEN(TRIM(sle_filename.text))<=5 THEN
  85. MESSAGEBOX('错误','请检查文件名!')
  86. RETURN
  87. END IF
  88. if fileexists(sle_filename.text) then
  89. if messagebox("系统提示","指定文件已经存在,是否覆盖该文件?",Question!,YesNo!,2)=2 then
  90. return
  91. end if
  92. end if
  93. CHOOSE CASE ddlb_dataformat_INDEX
  94. CASE 1 //EXCEL
  95. n_cst_dw2Excel lnv_Excel
  96. SAVE_RSLT = lnv_Excel.OF_dw2Excel(obj_dw,sle_filename.Text,'Sheet1')
  97. CASE 2 //HTML
  98. SAVE_RSLT=obj_dw.SaveAs(sle_filename.TEXT,HTMLTable!,FALSE)
  99. CASE 3 //TEXT
  100. SAVE_RSLT=obj_dw.SaveAs(sle_filename.TEXT,Text!,FALSE)
  101. CASE 4 //CLB
  102. SAVE_RSLT=obj_dw.SaveAs(sle_filename.TEXT,Clipboard!,FALSE)
  103. CASE ELSE
  104. END CHOOSE
  105. IF SAVE_RSLT=1 THEN
  106. messagebox("成功信息","数据发送操作成功!")
  107. ELSE
  108. messagebox("失败信息","数据发送操作失败!请检查目标文件名称是否拼写正确!")
  109. END IF
  110. //Clipboard! Save to the clipboard
  111. //CSV! ?Comma-separated values
  112. //dBASE2! ?dBASE-II format
  113. //dBASE3! ?dBASE-III format
  114. //DIF! ?Data Interchange Format
  115. //Excel! ?Microsoft Excel format
  116. //Excel5! ?Microsoft Excel 5 format
  117. //HTMLTable! ?Text with HTML formatting that approximates the DataWindow layout
  118. //PSReport! ?Powersoft Report (PSR) format
  119. //SQLInsert! ?SQL syntax
  120. //SYLK! ?Microsoft Multiplan format
  121. //Text! ?(Default) Tab-separated columns with a return at the end of each row
  122. //WKS! ?Lotus 1-2-3 format
  123. //WK1! ?Lotus 1-2-3 format
  124. //WMF! ?Windows Metafile format
  125. end event
  126. type st_1 from statictext within w_rpt_sentdataout
  127. integer x = 73
  128. integer y = 32
  129. integer width = 480
  130. integer height = 48
  131. integer textsize = -9
  132. integer weight = 400
  133. fontcharset fontcharset = gb2312charset!
  134. fontpitch fontpitch = variable!
  135. string facename = "宋体"
  136. long textcolor = 33554432
  137. long backcolor = 79741120
  138. string text = "目标发送数据格式:"
  139. boolean focusrectangle = false
  140. end type
  141. type sle_filename from singlelineedit within w_rpt_sentdataout
  142. integer x = 96
  143. integer y = 216
  144. integer width = 1559
  145. integer height = 92
  146. integer taborder = 50
  147. integer textsize = -9
  148. integer weight = 400
  149. fontcharset fontcharset = gb2312charset!
  150. fontpitch fontpitch = variable!
  151. string facename = "宋体"
  152. long textcolor = 33554432
  153. borderstyle borderstyle = stylelowered!
  154. end type
  155. type cb_ch from commandbutton within w_rpt_sentdataout
  156. integer x = 1659
  157. integer y = 216
  158. integer width = 114
  159. integer height = 92
  160. integer taborder = 60
  161. integer textsize = -9
  162. integer weight = 400
  163. fontcharset fontcharset = gb2312charset!
  164. fontpitch fontpitch = variable!
  165. string facename = "宋体"
  166. string text = "..."
  167. end type
  168. event clicked;string DATAFORMAT=''
  169. integer i
  170. string pathname,filename
  171. CHOOSE CASE ddlb_dataformat_INDEX
  172. CASE 1 //EXCEL
  173. DATAFORMAT='XLS'
  174. CASE 2 //HTML
  175. DATAFORMAT='HTML'
  176. CASE 3 //TEXT
  177. DATAFORMAT='TXT'
  178. CASE ELSE
  179. END CHOOSE
  180. i=getfilesavename("给予目标文件名",pathname,filename,DATAFORMAT,ddlb_dataformat.text+',*.'+DATAFORMAT)
  181. IF i=1 AND TRIM(pathname)<>'' AND TRIM(FILENAME)<>"" THEN
  182. sle_filename.text=pathname
  183. END IF
  184. end event
  185. type gb_1 from groupbox within w_rpt_sentdataout
  186. integer x = 32
  187. integer y = 136
  188. integer width = 1810
  189. integer height = 216
  190. integer taborder = 30
  191. integer textsize = -9
  192. integer weight = 400
  193. fontcharset fontcharset = gb2312charset!
  194. fontpitch fontpitch = variable!
  195. string facename = "宋体"
  196. long textcolor = 33554432
  197. long backcolor = 79741120
  198. string text = "发送的目标文件路径及名称"
  199. end type
  200. type ddlb_dataformat from dropdownlistbox within w_rpt_sentdataout
  201. integer x = 544
  202. integer y = 20
  203. integer width = 571
  204. integer height = 740
  205. integer taborder = 20
  206. boolean bringtotop = true
  207. integer textsize = -9
  208. integer weight = 400
  209. fontcharset fontcharset = gb2312charset!
  210. fontpitch fontpitch = variable!
  211. string facename = "宋体"
  212. long textcolor = 33554432
  213. boolean sorted = false
  214. boolean vscrollbar = true
  215. string item[] = {"Excel (*.xls)","HTML (*.htmL)","Text (*.txt)","剪切板"}
  216. borderstyle borderstyle = stylelowered!
  217. end type
  218. event constructor;if THIS.TotalItems ( )>=1 then THIS.SelectItem(1)
  219. end event
  220. event selectionchanged;ddlb_dataformat_INDEX=index
  221. IF INDEX =4 THEN
  222. sle_filename.ENABLED=FALSE
  223. cb_ch.ENABLED=FALSE
  224. ELSE
  225. sle_filename.ENABLED=TRUE
  226. cb_ch.ENABLED=TRUE
  227. END IF
  228. sle_filename.TEXT=''
  229. end event