w_rpt_preview.srw 50 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719
  1. $PBExportHeader$w_rpt_preview.srw
  2. forward
  3. global type w_rpt_preview from w_rpt_publ_base
  4. end type
  5. type st_1 from statictext within w_rpt_preview
  6. end type
  7. type ddlb_printerlist from dropdownlistbox within w_rpt_preview
  8. end type
  9. type cb_mdfmxrp from commandbutton within w_rpt_preview
  10. end type
  11. type cb_direcprint from uo_imflatbutton within w_rpt_preview
  12. end type
  13. type ln_bar from line within w_rpt_preview
  14. end type
  15. type ln_bar2 from line within w_rpt_preview
  16. end type
  17. type r_bar from rectangle within w_rpt_preview
  18. end type
  19. type cb_3 from uo_imflatbutton within w_rpt_preview
  20. end type
  21. type cb_refresh from uo_imflatbutton within w_rpt_preview
  22. end type
  23. type cb_indirectprint from uo_imflatbutton within w_rpt_preview
  24. end type
  25. type st_2 from statictext within w_rpt_preview
  26. end type
  27. type st_3 from statictext within w_rpt_preview
  28. end type
  29. type st_4 from statictext within w_rpt_preview
  30. end type
  31. type st_5 from statictext within w_rpt_preview
  32. end type
  33. type em_1 from editmask within w_rpt_preview
  34. end type
  35. type em_2 from editmask within w_rpt_preview
  36. end type
  37. type cbx_1 from checkbox within w_rpt_preview
  38. end type
  39. type dw_1 from u_rpt_dw_rbtnfilter within w_rpt_preview
  40. end type
  41. type ln_1 from line within w_rpt_preview
  42. end type
  43. type ln_2 from line within w_rpt_preview
  44. end type
  45. end forward
  46. global type w_rpt_preview from w_rpt_publ_base
  47. integer x = 9
  48. integer y = 24
  49. integer width = 3529
  50. integer height = 2000
  51. string title = "龙嘉数据打印预览窗口"
  52. boolean minbox = false
  53. windowtype windowtype = response!
  54. windowstate windowstate = maximized!
  55. event ue_filter ( )
  56. event ue_sentdataout ( )
  57. event ue_setprintpage_value ( )
  58. event ue_spp ( )
  59. event ue_snp ( )
  60. event ue_retrieve_dw ( )
  61. st_1 st_1
  62. ddlb_printerlist ddlb_printerlist
  63. cb_mdfmxrp cb_mdfmxrp
  64. cb_direcprint cb_direcprint
  65. ln_bar ln_bar
  66. ln_bar2 ln_bar2
  67. r_bar r_bar
  68. cb_3 cb_3
  69. cb_refresh cb_refresh
  70. cb_indirectprint cb_indirectprint
  71. st_2 st_2
  72. st_3 st_3
  73. st_4 st_4
  74. st_5 st_5
  75. em_1 em_1
  76. em_2 em_2
  77. cbx_1 cbx_1
  78. dw_1 dw_1
  79. ln_1 ln_1
  80. ln_2 ln_2
  81. end type
  82. global w_rpt_preview w_rpt_preview
  83. type prototypes
  84. //function boolean IsWindowsNT() library "PrintCtrl.dll"
  85. //SUBROUTINE About() library "PrintCtrl.dll"
  86. //function boolean GetDefaultPrinter(ref string PrinterName, int BufferLen) library "PrintCtrl.dll"
  87. //function boolean GetPrinterPort(ref string PrinterName, ref string Port, int PortLen, ref string Driver, int DriverLen) library "PrintCtrl.dll"
  88. //function boolean GetPrinterList(ref string PrinterList, ref long bufferLen) library "PrintCtrl.dll"
  89. //function boolean GetPrinterStatus(ref string Printer, ref long status) library "PrintCtrl.dll"
  90. //function boolean GetPaperList(ref string Printer, ref string PaperList, ref long bufferLen) library "PrintCtrl.dll"
  91. //function boolean SetPrinterDefault(ref string Printer) library "PrintCtrl.dll"
  92. //function boolean AddCustomPaper( ref string Printer, ref string PaperName, long pwidth, long pheight, long left, long right, long top, long bottom) library "PrintCtrl.dll"
  93. //function boolean DeleteCustomPaper(ref string Printer, ref string PaperName) library "PrintCtrl.dll"
  94. //function boolean SetUserDefinePaper(ref string Printer, ref long pWidth, ref long pHeight) library "PrintCtrl.dll"
  95. //function boolean GetUserDefinePaperMinMax(ref string Printer, ref long minWidth, ref long minHeight, ref long maxWidth, ref long maxHeight) library "PrintCtrl.dll"
  96. //function boolean GetDefaultPaper(ref string Printer, ref string PaperName, ref int nOrientation) library "PrintCtrl.dll"
  97. //function boolean SetDefaultPaper(ref string Printer, ref string PaperName, int nOrientation) library "PrintCtrl.dll"
  98. //function boolean GetDefaultPaper(ref string Printer, ref string PaperName,ref long nPapserSize, ref long nOrientation) library "PrintCtrl.dll"
  99. //function boolean GetPaperName(ref string Printer, ref string PaperName, int PaperSize) library "PrintCtrl.dll"
  100. //function boolean GetPaperSize(ref string Printer, ref string PaperName, ref int PaperSize) library "PrintCtrl.dll"
  101. //function boolean GetBinNameList(ref string Printer, ref string BinNameList) library "PrintCtrl.dll"
  102. //function boolean GetBin(ref string Printer, ref string BinName, ref int Bin) library "PrintCtrl.dll"
  103. //function boolean GetBinName(ref string Printer, ref string BinName, int Bin) library "PrintCtrl.dll"
  104. end prototypes
  105. type variables
  106. s_rpt_print_msg fact_print_msg
  107. string dwdataobject
  108. datawindowchild ins_dwcld
  109. s_childreportxwidth s_xwidth
  110. dwobject dwod
  111. long retrieveid=0,secondretrieveid=0,scid=0
  112. uo_rpt_printer_setting lnv_printer
  113. string ins_printerlist [ ]
  114. int p_printerlist =0
  115. string dw_default_printer ='',default_printer =''
  116. string default_printer_info=''
  117. long print_row
  118. string default_dwname,default_dname
  119. int rslt_printnum = 0
  120. string rpt_inifilename = 'longjoeERP_rpt.ini'
  121. long reportid,printrow
  122. end variables
  123. forward prototypes
  124. public function integer dw_retrieve ()
  125. public function integer wf_mdfmxreport (s_childreportxwidth s_xw)
  126. public function integer wf_mdfx (s_childreportxwidth s_xw, integer pt)
  127. public function integer wf_initprinterinfo ()
  128. public function integer wf_setdefaultprinter ()
  129. public function integer wf_write_childdw_pos (string arg_childdw_name, s_childreportxwidth arg_s_xwidth)
  130. public function integer wf_read_childdw_pos (string arg_childdw_name, ref s_childreportxwidth arg_s_xwidth)
  131. public subroutine wf_readini_begin ()
  132. public function integer wf_trycreate_sys_dwnsyntax (ref string arg_msg)
  133. public function integer wf_dwcreate (string arg_dwname, string arg_formatname, ref string arg_errmsg)
  134. public subroutine wf_defdataobject ()
  135. public subroutine wf_subdwpos_strutoblob (s_childreportxwidth arg_s_xwidth, ref blob subdwpos)
  136. public subroutine wf_subdwpos_blobtostru (blob arg_blob, ref s_childreportxwidth arg_s_xwidth)
  137. public function integer wf_read_subdwpos (string arg_dwname, string arg_dname, ref s_childreportxwidth s_subdwwidth, ref string arg_msg)
  138. public subroutine wf_nullrow (long arg_rowcnt, long arg_pagerow, ref long arg_nullrow)
  139. public subroutine wf_check_ini ()
  140. public subroutine wf_setprofile ()
  141. public subroutine wf_retrdw_dt ()
  142. public function integer wf_face_change ()
  143. end prototypes
  144. event ue_filter();OPENWITHPARM(w_filter_query,dw_1)
  145. STRING LS_EXPR
  146. LS_EXPR=Message.StringParm
  147. if len(LS_EXPR)>2 and trim(LS_EXPR)='' then return
  148. dw_1.setfilter(LS_EXPR)
  149. dw_1.SetRedraw (false)
  150. dw_1.filter()
  151. dw_1.SetRedraw (TRUE)
  152. end event
  153. event ue_sentdataout;OPENWITHPARM(w_rpt_sentdataout,dw_1)
  154. end event
  155. event ue_setprintpage_value();s_rpt_print_value s_print
  156. s_print.obj_dw = DW_1
  157. s_print.dft_printername = ddlb_printerlist.Text
  158. s_print.printrow = printrow
  159. s_print.print_msg = fact_print_msg
  160. OpenWithParm(w_rpt_printpage_value,s_print)
  161. s_rpt_print_msg S_INSCUST
  162. S_INSCUST = Message.PowerObjectParm
  163. IF S_INSCUST.retr_flag = TRUE THEN
  164. f_retrieve_dw(dw_1,S_INSCUST)
  165. else
  166. wf_retrdw_dt()
  167. END IF
  168. fact_print_msg = S_INSCUST
  169. end event
  170. event ue_spp();dw_1.ScrollPriorPage()
  171. end event
  172. event ue_snp();dw_1.ScrollNextPage()
  173. end event
  174. event ue_retrieve_dw();IF fact_print_msg.retr_flag THEN
  175. dw_1.Retrieve(scid,retrieveid,printrow)
  176. END IF
  177. end event
  178. public function integer dw_retrieve ();//dw_retrieve
  179. CHOOSE CASE fact_print_msg.retr_pram_falg
  180. CASE 0 //SHARE DATAWINDOW
  181. DATAWINDOW LS_DW
  182. LS_DW = fact_print_msg.SHARE_DW
  183. LS_DW.ShareData(DW_1)
  184. CASE 1 //ONE STRING PRAM
  185. DW_1.Retrieve(fact_print_msg.retr_pramstr)
  186. CASE 2 //ONE NUMBER PRAM
  187. DW_1.Retrieve(fact_print_msg.retr_pramnmb)
  188. retrieveid = fact_print_msg.retr_pramnmb
  189. CASE 3 //ONE DATE PRAM
  190. DW_1.Retrieve(fact_print_msg.retr_pramfd)
  191. CASE 4 //TWO DATE PRAM
  192. DW_1.Retrieve(fact_print_msg.retr_pramfd,fact_print_msg.retr_pramed)
  193. CASE 5 //TWO NUMBER PRAM
  194. DW_1.Retrieve(fact_print_msg.retr_pramnmb,fact_print_msg.b_long)
  195. CASE 6 //TWO DATETIME PRAM
  196. DW_1.Retrieve(fact_print_msg.retr_pramfdt,fact_print_msg.retr_pramedt)
  197. CASE 11 //scid string
  198. DW_1.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramstr)
  199. CASE 12 //scid long
  200. DW_1.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb)
  201. CASE 13 //scid long and TWO NUMBER PRAM
  202. DW_1.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb,fact_print_msg.b_long)
  203. CASE 14 //ONE NUMBER PRAM and ONE STRING PRAM
  204. DW_1.Retrieve(fact_print_msg.retr_pramnmb,fact_print_msg.retr_pramstr)
  205. CASE 15 //scid long and TWO NUMBER PRAM and null_row
  206. wf_nullrow(fact_print_msg.rowcnt,fact_print_msg.printrow,fact_print_msg.nullrow)
  207. DW_1.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb,fact_print_msg.printrow,fact_print_msg.nullrow)
  208. CASE ELSE
  209. DW_1.Retrieve()
  210. END CHOOSE
  211. IF fact_print_msg.retr_pram_falg <> 0 THEN
  212. DW_1.SetFilter(fact_print_msg.FILTER_STRING)
  213. DW_1.Filter()
  214. END IF
  215. //dw_1.object.title.text=sys_message_report_title
  216. //messagebox('',sys_message_report_title)
  217. RETURN 0
  218. end function
  219. public function integer wf_mdfmxreport (s_childreportxwidth s_xw);//wf_mdfmxreport(s_childreportxwidth)
  220. if s_xw.p=0 then
  221. return 0
  222. end if
  223. if mod(s_xw.cmplp,2)=1 then
  224. if s_xw.cmplx[1]>0 then dwod.object.cmpl1.width=s_xw.cmplwidth[1]
  225. end if
  226. if s_xw.cmplp=2 or s_xw.cmplp=3 then
  227. if s_xw.cmplx[2]>0 then dwod.object.cmpl2.width= s_xw.cmplwidth[2]
  228. end if
  229. if s_xw.cmplp=4 or s_xw.cmplp=6 or s_xw.cmplp=7 then
  230. if s_xw.cmplx[3]>0 then dwod.object.cmpl3.width= s_xw.cmplwidth[3]
  231. end if
  232. if s_xw.x[1]>0 then dwod.object.#1.width=s_xw.width[1]
  233. if s_xw.p<2 then goto mdfx
  234. if s_xw.x[2]>0 then dwod.object.#2.width=s_xw.width[2]
  235. if s_xw.p<3 then goto mdfx
  236. if s_xw.x[3]>0 then dwod.object.#3.width=s_xw.width[3]
  237. if s_xw.p<4 then goto mdfx
  238. if s_xw.x[4]>0 then dwod.object.#4.width=s_xw.width[4]
  239. if s_xw.p<5 then goto mdfx
  240. if s_xw.x[5]>0 then dwod.object.#5.width=s_xw.width[5]
  241. if s_xw.p<6 then goto mdfx
  242. if s_xw.x[6]>0 then dwod.object.#6.width=s_xw.width[6]
  243. if s_xw.p<7 then goto mdfx
  244. if s_xw.x[7]>0 then dwod.object.#7.width=s_xw.width[7]
  245. if s_xw.p<8 then goto mdfx
  246. if s_xw.x[8]>0 then dwod.object.#8.width=s_xw.width[8]
  247. if s_xw.p<9 then goto mdfx
  248. if s_xw.x[9]>0 then dwod.object.#9.width=s_xw.width[9]
  249. if s_xw.p<10 then goto mdfx
  250. if s_xw.x[10]>0 then dwod.object.#10.width=s_xw.width[10]
  251. if s_xw.p<11 then goto mdfx
  252. if s_xw.x[11]>0 then dwod.object.#11.width=s_xw.width[11]
  253. if s_xw.p<12 then goto mdfx
  254. if s_xw.x[12]>0 then dwod.object.#12.width=s_xw.width[12]
  255. if s_xw.p<13 then goto mdfx
  256. if s_xw.x[13]>0 then dwod.object.#13.width=s_xw.width[13]
  257. if s_xw.p<14 then goto mdfx
  258. if s_xw.x[14]>0 then dwod.object.#14.width=s_xw.width[14]
  259. if s_xw.p<15 then goto mdfx
  260. if s_xw.x[15]>0 then dwod.object.#15.width=s_xw.width[15]
  261. if s_xw.p<16 then goto mdfx
  262. if s_xw.x[16]>0 then dwod.object.#16.width=s_xw.width[16]
  263. if s_xw.p<17 then goto mdfx
  264. if s_xw.x[17]>0 then dwod.object.#17.width=s_xw.width[17]
  265. if s_xw.p<18 then goto mdfx
  266. if s_xw.x[18]>0 then dwod.object.#18.width=s_xw.width[18]
  267. if s_xw.p<19 then goto mdfx
  268. if s_xw.x[19]>0 then dwod.object.#19.width=s_xw.width[19]
  269. if s_xw.p<20 then goto mdfx
  270. if s_xw.x[20]>0 then dwod.object.#20.width=s_xw.width[20]
  271. if s_xw.p<21 then goto mdfx
  272. if s_xw.x[21]>0 then dwod.object.#21.width=s_xw.width[21]
  273. if s_xw.p<22 then goto mdfx
  274. if s_xw.x[22]>0 then dwod.object.#22.width=s_xw.width[22]
  275. if s_xw.p<23 then goto mdfx
  276. if s_xw.x[23]>0 then dwod.object.#23.width=s_xw.width[23]
  277. if s_xw.p<24 then goto mdfx
  278. if s_xw.x[24]>0 then dwod.object.#24.width=s_xw.width[24]
  279. if s_xw.p<25 then goto mdfx
  280. if s_xw.x[25]>0 then dwod.object.#25.width=s_xw.width[25]
  281. if s_xw.p<26 then goto mdfx
  282. if s_xw.x[26]>0 then dwod.object.#26.width=s_xw.width[26]
  283. if s_xw.p<27 then goto mdfx
  284. if s_xw.x[27]>0 then dwod.object.#27.width=s_xw.width[27]
  285. if s_xw.p<28 then goto mdfx
  286. if s_xw.x[28]>0 then dwod.object.#28.width=s_xw.width[28]
  287. if s_xw.p<29 then goto mdfx
  288. if s_xw.x[29]>0 then dwod.object.#29.width=s_xw.width[29]
  289. mdfx:
  290. if mod(s_xw.cmplp,2)=1 then
  291. if s_xw.cmplx[1]>0 then dwod.object.cmpl1.x= s_xw.cmplx[1] - 9
  292. end if
  293. if s_xw.cmplp=2 or s_xw.cmplp=3 then
  294. if s_xw.cmplx[2]>0 then dwod.object.cmpl2.x= s_xw.cmplx[2] - 9
  295. end if
  296. if s_xw.cmplp=4 or s_xw.cmplp=6 or s_xw.cmplp=7 then
  297. if s_xw.cmplx[3]>0 then dwod.object.cmpl3.x= s_xw.cmplx[3] - 9
  298. end if
  299. long obp,bp,bi,bj,bk
  300. obp=0
  301. for bi=1 to s_xw.p
  302. bp=50000
  303. bk=0
  304. for bj=1 to s_xw.p
  305. if s_xw.x[bj]<bp and s_xw.x[bj]>obp and s_xw.x[bj]>0 then
  306. bp=s_xw.x[bj]
  307. bk=bj
  308. end if
  309. next
  310. if mod(s_xw.cmplp,2)=1 then
  311. if s_xw.cmplx[1]<bp and s_xw.cmplx[1]>obp and s_xw.cmplx[1]>0 then
  312. bp=s_xw.cmplx[1]
  313. bk=0
  314. bi = bi -1
  315. dwod.object.cmpl1.x= s_xw.cmplx[1] - 9
  316. end if
  317. end if
  318. wf_mdfx(s_xw,bk)
  319. obp=bp
  320. next
  321. if mod(s_xw.cmplp,2)=1 then
  322. if s_xw.cmplx[1]>0 then dwod.object.cmpl1.x= s_xw.cmplx[1] - 9
  323. end if
  324. if s_xw.cmplp=2 or s_xw.cmplp=3 then
  325. if s_xw.cmplx[2]>0 then dwod.object.cmpl2.x= s_xw.cmplx[2] - 9
  326. end if
  327. if s_xw.cmplp=4 or s_xw.cmplp=6 or s_xw.cmplp=7 then
  328. if s_xw.cmplx[3]>0 then dwod.object.cmpl3.x= s_xw.cmplx[3] - 9
  329. end if
  330. //if s_xw.x[1]>0 then dwod.object.#1.x=s_xw.x[1] - 1
  331. //if s_xw.p<2 then goto ext
  332. //if s_xw.x[2]>0 then dwod.object.#2.x=s_xw.x[2] - 1
  333. //if s_xw.p<3 then goto ext
  334. //if s_xw.x[3]>0 then dwod.object.#3.x=s_xw.x[3] - 1
  335. //if s_xw.p<4 then goto ext
  336. //if s_xw.x[4]>0 then dwod.object.#4.x=s_xw.x[4] - 1
  337. //if s_xw.p<5 then goto ext
  338. //if s_xw.x[5]>0 then dwod.object.#5.x=s_xw.x[5] - 1
  339. //if s_xw.p<6 then goto ext
  340. //if s_xw.x[6]>0 then dwod.object.#6.x=s_xw.x[6] - 1
  341. //if s_xw.p<7 then goto ext
  342. //if s_xw.x[7]>0 then dwod.object.#7.x=s_xw.x[7] - 1
  343. //if s_xw.p<8 then goto ext
  344. //if s_xw.x[8]>0 then dwod.object.#8.x=s_xw.x[8] - 1
  345. //if s_xw.p<9 then goto ext
  346. //if s_xw.x[9]>0 then dwod.object.#9.x=s_xw.x[9] - 1
  347. //if s_xw.p<10 then goto ext
  348. //if s_xw.x[10]>0 then dwod.object.#10.x=s_xw.x[10] - 1
  349. //if s_xw.p<11 then goto ext
  350. //if s_xw.x[11]>0 then dwod.object.#11.x=s_xw.x[11] - 1
  351. //if s_xw.p<12 then goto ext
  352. //if s_xw.x[12]>0 then dwod.object.#12.x=s_xw.x[12] - 1
  353. //if s_xw.p<13 then goto ext
  354. //if s_xw.x[13]>0 then dwod.object.#13.x=s_xw.x[13] - 1
  355. //if s_xw.p<14 then goto ext
  356. //if s_xw.x[14]>0 then dwod.object.#14.x=s_xw.x[14] - 1
  357. //if s_xw.p<15 then goto ext
  358. //if s_xw.x[15]>0 then dwod.object.#15.x=s_xw.x[15] - 1
  359. //if s_xw.p<16 then goto ext
  360. //if s_xw.x[16]>0 then dwod.object.#16.x=s_xw.x[16] - 1
  361. //if s_xw.p<17 then goto ext
  362. //if s_xw.x[17]>0 then dwod.object.#17.x=s_xw.x[17] - 1
  363. //if s_xw.p<18 then goto ext
  364. //if s_xw.x[18]>0 then dwod.object.#18.x=s_xw.x[18] - 1
  365. //if s_xw.p<19 then goto ext
  366. //if s_xw.x[19]>0 then dwod.object.#19.x=s_xw.x[19] - 1
  367. //if s_xw.p<20 then goto ext
  368. //if s_xw.x[20]>0 then dwod.object.#20.x=s_xw.x[20] - 1
  369. //if s_xw.p<21 then goto ext
  370. //if s_xw.x[21]>0 then dwod.object.#21.x=s_xw.x[21] - 1
  371. //if s_xw.p<22 then goto ext
  372. //if s_xw.x[22]>0 then dwod.object.#22.x=s_xw.x[22] - 1
  373. //if s_xw.p<23 then goto ext
  374. //if s_xw.x[23]>0 then dwod.object.#23.x=s_xw.x[23] - 1
  375. //if s_xw.p<24 then goto ext
  376. //if s_xw.x[24]>0 then dwod.object.#24.x=s_xw.x[24] - 1
  377. //if s_xw.p<25 then goto ext
  378. //if s_xw.x[25]>0 then dwod.object.#25.x=s_xw.x[25] - 1
  379. //if s_xw.p<26 then goto ext
  380. //if s_xw.x[26]>0 then dwod.object.#26.x=s_xw.x[26] - 1
  381. //if s_xw.p<27 then goto ext
  382. //if s_xw.x[27]>0 then dwod.object.#27.x=s_xw.x[27] - 1
  383. //if s_xw.p<28 then goto ext
  384. //if s_xw.x[28]>0 then dwod.object.#28.x=s_xw.x[28] - 1
  385. //if s_xw.p<29 then goto ext
  386. //if s_xw.x[29]>0 then dwod.object.#29.x=s_xw.x[29] - 1
  387. //
  388. //ext:
  389. return 0
  390. end function
  391. public function integer wf_mdfx (s_childreportxwidth s_xw, integer pt);//wf_mdfx(s_childreportxwidth,int)
  392. if s_xw.p=0 or pt=0 then
  393. return 0
  394. end if
  395. CHOOSE CASE pt
  396. CASE 1
  397. if s_xw.p>=1 and s_xw.x[1]>0 then dwod.object.#1.x=s_xw.x[1] - 9
  398. CASE 2
  399. if s_xw.p>=2 and s_xw.x[2]>0 then dwod.object.#2.x=s_xw.x[2] - 9
  400. CASE 3
  401. if s_xw.p>=3 and s_xw.x[3]>0 then dwod.object.#3.x=s_xw.x[3] - 9
  402. CASE 4
  403. if s_xw.p>=4 and s_xw.x[4]>0 then dwod.object.#4.x=s_xw.x[4] - 9
  404. CASE 5
  405. if s_xw.p>=5 and s_xw.x[5]>0 then dwod.object.#5.x=s_xw.x[5] - 9
  406. CASE 6
  407. if s_xw.p>=6 and s_xw.x[6]>0 then dwod.object.#6.x=s_xw.x[6] - 9
  408. CASE 7
  409. if s_xw.p>=7 and s_xw.x[7]>0 then dwod.object.#7.x=s_xw.x[7] - 9
  410. CASE 8
  411. if s_xw.p>=8 and s_xw.x[8]>0 then dwod.object.#8.x=s_xw.x[8] - 9
  412. CASE 9
  413. if s_xw.p>=9 and s_xw.x[9]>0 then dwod.object.#9.x=s_xw.x[9] - 9
  414. CASE 10
  415. if s_xw.p>=10 and s_xw.x[10]>0 then dwod.object.#10.x=s_xw.x[10] - 9
  416. CASE 11
  417. if s_xw.p>=11 and s_xw.x[11]>0 then dwod.object.#11.x=s_xw.x[11] - 9
  418. CASE 12
  419. if s_xw.p>=12 and s_xw.x[12]>0 then dwod.object.#12.x=s_xw.x[12] - 9
  420. CASE 13
  421. if s_xw.p>=13 and s_xw.x[13]>0 then dwod.object.#13.x=s_xw.x[13] - 9
  422. CASE 14
  423. if s_xw.p>=14 and s_xw.x[14]>0 then dwod.object.#14.x=s_xw.x[14] - 9
  424. CASE 15
  425. if s_xw.p>=15 and s_xw.x[15]>0 then dwod.object.#15.x=s_xw.x[15] - 9
  426. CASE 16
  427. if s_xw.p>=16 and s_xw.x[16]>0 then dwod.object.#16.x=s_xw.x[16] - 9
  428. CASE 17
  429. if s_xw.p>=17 and s_xw.x[17]>0 then dwod.object.#17.x=s_xw.x[17] - 9
  430. CASE 18
  431. if s_xw.p>=18 and s_xw.x[18]>0 then dwod.object.#18.x=s_xw.x[18] - 9
  432. CASE 19
  433. if s_xw.p>=19 and s_xw.x[19]>0 then dwod.object.#19.x=s_xw.x[19] - 9
  434. CASE 20
  435. if s_xw.p>=20 and s_xw.x[20]>0 then dwod.object.#20.x=s_xw.x[20] - 9
  436. CASE 21
  437. if s_xw.p>=21 and s_xw.x[21]>0 then dwod.object.#21.x=s_xw.x[21] - 9
  438. CASE 22
  439. if s_xw.p>=22 and s_xw.x[22]>0 then dwod.object.#22.x=s_xw.x[22] - 9
  440. CASE 23
  441. if s_xw.p>=23 and s_xw.x[23]>0 then dwod.object.#23.x=s_xw.x[23] - 9
  442. CASE 24
  443. if s_xw.p>=24 and s_xw.x[24]>0 then dwod.object.#24.x=s_xw.x[24] - 9
  444. CASE 25
  445. if s_xw.p>=25 and s_xw.x[25]>0 then dwod.object.#25.x=s_xw.x[25] - 9
  446. CASE 26
  447. if s_xw.p>=26 and s_xw.x[26]>0 then dwod.object.#26.x=s_xw.x[26] - 9
  448. CASE 27
  449. if s_xw.p>=27 and s_xw.x[27]>0 then dwod.object.#27.x=s_xw.x[27] - 9
  450. CASE 28
  451. if s_xw.p>=28 and s_xw.x[28]>0 then dwod.object.#28.x=s_xw.x[28] - 9
  452. CASE 29
  453. if s_xw.p>=29 and s_xw.x[29]>0 then dwod.object.#29.x=s_xw.x[29] - 9
  454. END CHOOSE
  455. return 0
  456. end function
  457. public function integer wf_initprinterinfo ();///////////////////////读取打印机信息
  458. //// 用uo取打印机列表
  459. //int ls_ii
  460. //p_printerlist = lnv_printer.of_GetPrinterList ( ins_printerlist )
  461. //
  462. //for ls_ii=1 to p_printerlist
  463. // ddlb_printerlist.additem(ins_printerlist[ls_ii])
  464. //next
  465. ////用dll取打印机列表
  466. //String printerlist = Space(512)
  467. //Long bufferlen = 512
  468. //Boolean rt
  469. //ddlb_printerlist.Reset()
  470. //Long p1,p2
  471. //p1 = 1
  472. //p2 = 0
  473. //rt = GetPrinterList(REF printerlist, REF bufferlen)
  474. //IF rt THEN
  475. // p2 = Pos(printerlist,"~t",p1)
  476. // DO WHILE p2 > 0
  477. // ddlb_printerlist.AddItem(Mid(printerlist,p1,p2 - p1))
  478. // p1 = p2+1
  479. // p2 = Pos(printerlist,"~t",p1)
  480. // LOOP
  481. //END IF
  482. //用pb取打印机列表
  483. String ls_left, ls_prntrs,ls_printername
  484. Long ll_pos_n,ll_pos_t
  485. ddlb_printerlist.Reset()
  486. ls_prntrs = PrintGetPrinters()
  487. DO WHILE Len(Trim(ls_prntrs)) > 0
  488. ll_pos_n = Pos (ls_prntrs, "~n" )
  489. IF ll_pos_n > 0 THEN
  490. ls_left = Left (ls_prntrs, ll_pos_n - 1)
  491. ll_pos_t = Pos (ls_left, "~t" )
  492. ls_printername = Left (ls_left, ll_pos_t - 1)
  493. ddlb_printerlist.AddItem(ls_printername)
  494. ls_prntrs = Mid (ls_prntrs, ll_pos_n + 1)
  495. ELSE
  496. ll_pos_t = Pos (ls_prntrs, "~t" )
  497. ls_printername = Left (ls_prntrs, ll_pos_t - 1)
  498. ddlb_printerlist.AddItem(ls_printername)
  499. ls_prntrs = ''
  500. END IF
  501. LOOP
  502. // 取PB缺省打印机
  503. default_printer = lnv_printer.of_GetPBPrinter ( )
  504. //// 取dll缺省打印机
  505. //String printerName
  506. //Boolean rt_1
  507. //printerName = Space(255)
  508. //rt_1 = GetDefaultPrinter(REF printerName, 255)
  509. //IF rt_1 THEN
  510. // default_printer = Trim(printerName)
  511. //ELSE
  512. // default_printer = ''
  513. //END IF
  514. //取PB缺省打印机设置字符串
  515. default_printer_info=ProfileString ( "win.ini", "windows", "device", "" )
  516. return 0
  517. end function
  518. public function integer wf_setdefaultprinter ();///wf_setdefaultprinter
  519. if default_printer_info='' or pos(default_printer_info,',')=0 then return 0
  520. f_SetProfileString (sys_empid,'windows', "device", default_printer_info)
  521. return 1
  522. end function
  523. public function integer wf_write_childdw_pos (string arg_childdw_name, s_childreportxwidth arg_s_xwidth);//wf_write_childdw_pos(string arg_childdw_name,s_childreportxwidth arg_s_xwidth)
  524. //
  525. long ls_clmxp,ls_clm_cmplxp
  526. long i,j
  527. //列数
  528. ls_clmxp=arg_s_xwidth.p
  529. if ls_clmxp > 0 then
  530. for i=1 to ls_clmxp
  531. f_SetProfileString (sys_empid,arg_childdw_name, string(i)+".x",string(arg_s_xwidth.x[i]))
  532. f_SetProfileString (sys_empid,arg_childdw_name, string(i)+".width",string(arg_s_xwidth.width[i]))
  533. next
  534. end if
  535. //计算列数量
  536. ls_clm_cmplxp=arg_s_xwidth.cmplp
  537. choose case ls_clm_cmplxp
  538. case 1
  539. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(1)+".x",string(arg_s_xwidth.cmplx[1]))
  540. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(1)+".width",string(arg_s_xwidth.cmplwidth[1]))
  541. case 2
  542. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".x",string(arg_s_xwidth.cmplx[2]))
  543. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".width",string(arg_s_xwidth.cmplwidth[2]))
  544. case 3
  545. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(1)+".x",string(arg_s_xwidth.cmplx[1]))
  546. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(1)+".width",string(arg_s_xwidth.cmplwidth[1]))
  547. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".x",string(arg_s_xwidth.cmplx[2]))
  548. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".width",string(arg_s_xwidth.cmplwidth[2]))
  549. case 4
  550. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(4)+".x",string(arg_s_xwidth.cmplx[4]))
  551. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(4)+".width",string(arg_s_xwidth.cmplwidth[4]))
  552. case 5
  553. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".x",string(arg_s_xwidth.cmplx[2]))
  554. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".width",string(arg_s_xwidth.cmplwidth[2]))
  555. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(3)+".x",string(arg_s_xwidth.cmplx[3]))
  556. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(3)+".width",string(arg_s_xwidth.cmplwidth[3]))
  557. case 6
  558. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".x",string(arg_s_xwidth.cmplx[2]))
  559. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".width",string(arg_s_xwidth.cmplwidth[2]))
  560. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(4)+".x",string(arg_s_xwidth.cmplx[3]))
  561. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(4)+".width",string(arg_s_xwidth.cmplwidth[3]))
  562. case 7
  563. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(1)+".x",string(arg_s_xwidth.cmplx[1]))
  564. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(1)+".width",string(arg_s_xwidth.cmplwidth[1]))
  565. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".x",string(arg_s_xwidth.cmplx[2]))
  566. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(2)+".width",string(arg_s_xwidth.cmplwidth[2]))
  567. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(4)+".x",string(arg_s_xwidth.cmplx[3]))
  568. f_SetProfileString (sys_empid,arg_childdw_name, "cmpl"+string(4)+".width",string(arg_s_xwidth.cmplwidth[3]))
  569. end choose
  570. return 1
  571. end function
  572. public function integer wf_read_childdw_pos (string arg_childdw_name, ref s_childreportxwidth arg_s_xwidth);//f_read_childdw_pos(string arg_childdw_name,s_childreportxwidth arg_s_xwidth)
  573. //
  574. int ls_i,ls_clmno
  575. int rslt=1
  576. datastore obj_dw
  577. obj_dw =create datastore
  578. obj_dw.dataobject=arg_childdw_name
  579. obj_dw.settransobject(sqlca)
  580. ls_clmno=integer(obj_dw.Describe('DataWindow.Column.Count'))
  581. if ls_clmno=0 then
  582. rslt=0
  583. goto ext
  584. end if
  585. for ls_i=1 to ls_clmno
  586. long column_xpos,column_width
  587. column_xpos=long(f_ProfileString (sys_empid,arg_childdw_name, string(ls_i)+".x",'-1'))
  588. column_width=long(f_ProfileString (sys_empid,arg_childdw_name, string(ls_i)+".width",'-1'))
  589. if column_xpos = -1 or column_width = -1 then
  590. rslt=0
  591. goto ext
  592. end if
  593. arg_s_xwidth.width[ls_i]=column_width
  594. arg_s_xwidth.x[ls_i]=column_xpos
  595. next
  596. arg_s_xwidth.p=ls_clmno
  597. if obj_dw.Describe('cmpl1.name')='cmpl1' then
  598. arg_s_xwidth.cmplwidth[1]=long(f_ProfileString (sys_empid,arg_childdw_name, "cmpl1.width",'-1'))
  599. arg_s_xwidth.cmplx[1]=long(f_ProfileString (sys_empid,arg_childdw_name, "cmpl1.x",'-1'))
  600. if arg_s_xwidth.cmplx[1] = -1 or arg_s_xwidth.cmplwidth[1] = -1 then
  601. rslt=0
  602. goto ext
  603. end if
  604. arg_s_xwidth.cmplp=1
  605. end if
  606. if obj_dw.Describe('cmpl2.name')='cmpl2' then
  607. arg_s_xwidth.cmplwidth[2]=long(f_ProfileString (sys_empid,arg_childdw_name, "cmpl2.width",'-1'))
  608. arg_s_xwidth.cmplx[2]=long(f_ProfileString (sys_empid,arg_childdw_name, "cmpl2.x",'-1'))
  609. if arg_s_xwidth.cmplx[2] = -1 or arg_s_xwidth.cmplwidth[2] = -1 then
  610. rslt=0
  611. goto ext
  612. end if
  613. arg_s_xwidth.cmplp=arg_s_xwidth.cmplp+2
  614. end if
  615. if obj_dw.Describe('cmpl3.name')='cmpl3' then
  616. arg_s_xwidth.cmplwidth[3]=long(f_ProfileString (sys_empid,arg_childdw_name, "cmpl3.width",'-1'))
  617. arg_s_xwidth.cmplx[3]=long(f_ProfileString (sys_empid,arg_childdw_name, "cmpl3.x",'-1'))
  618. if arg_s_xwidth.cmplx[3] = -1 or arg_s_xwidth.cmplwidth[3] = -1 then
  619. rslt=0
  620. goto ext
  621. end if
  622. arg_s_xwidth.cmplp=arg_s_xwidth.cmplp+4
  623. end if
  624. ext:
  625. return rslt
  626. end function
  627. public subroutine wf_readini_begin ();dwod=dw_1.object.mxreport
  628. s_mdfxwidth_tran s_mdfxw_tran
  629. s_mdfxw_tran.retrieveid=retrieveid
  630. //if em_1.enabled then
  631. // secondretrieveid=long(em_1.text)
  632. //end if
  633. s_mdfxw_tran.secondretrieveid=secondretrieveid
  634. s_mdfxw_tran.dataobject=dwod.dataobject
  635. if wf_read_childdw_pos(dwod.dataobject,s_xwidth)=0 then
  636. return
  637. end if
  638. wf_mdfmxreport(s_xwidth)
  639. end subroutine
  640. public function integer wf_trycreate_sys_dwnsyntax (ref string arg_msg);//wf_trycreate_sys_dwnsyntax
  641. long rslt=1
  642. long cnt
  643. string createsql_string,t_str
  644. createsql_string="CREATE TABLE sys_dwnSyntax ( dwname char (50) NOT NULL,dname char (50) NOT NULL,default_flag tinyint not null default (0),dwSyntaxB image not NULL DEFAULT (''),subdwSyntaxB image not NULL DEFAULT ('')) "+&
  645. " ~n ALTER TABLE sys_dwnSyntax WITH NOCHECK ADD CONSTRAINT PK_sys_dwnSyntax PRIMARY KEY CLUSTERED (dwname,dname)"
  646. t_str="select count(*) from sys_dwnSyntax"
  647. Execute immediate :t_str;
  648. if sqlca.sqlcode=0 then //已经存在该表
  649. rslt=1
  650. goto ext
  651. end if
  652. Execute immediate :createsql_string ;
  653. if sqlca.sqlcode<>0 then
  654. arg_msg='建立表sys_dwnSyntax失败>>'+sqlca.sqlerrtext
  655. rollback ;
  656. rslt=0
  657. goto ext
  658. end if
  659. commit ;
  660. ext:
  661. return rslt
  662. return 0
  663. end function
  664. public function integer wf_dwcreate (string arg_dwname, string arg_formatname, ref string arg_errmsg);blob dwSyntax
  665. int rslt=1
  666. selectblob dwSyntaxB into :dwSyntax from sys_dwnSyntax where dwname=:arg_dwname and dname=:arg_formatname;
  667. if sqlca.sqlcode=-1 then
  668. Messagebox('系统提示','查询单据格式失败,原因:'+sqlca.sqlerrtext)
  669. rslt=0
  670. goto ext
  671. end if
  672. //Messagebox('string(dwSyntax)',string(dwSyntax))
  673. if dw_1.create(string(dwSyntax),arg_errmsg)<>1 then
  674. Messagebox('系统提示',arg_errmsg)
  675. goto ext
  676. end if
  677. dw_1.object.DataWindow.Print.Preview = 'yes'
  678. dw_1.Object.DataWindow.Print.Duplex = 2
  679. dw_1.Object.DataWindow.Print.Preview.Rulers = "yes"
  680. ext:
  681. return rslt
  682. end function
  683. public subroutine wf_defdataobject ();String errmsg
  684. Long ls_count,rslt = 1
  685. Blob sqlblob
  686. SELECT count(*) INTO :ls_count FROM sys_dwnSyntax Where dwname = :fact_print_msg.obj_dwname AND default_flag = 1 ;
  687. IF sqlca.SQLCode = -1 THEN
  688. MessageBox('系统提示','查询单据格式失败'+sqlca.SQLErrText)
  689. RETURN
  690. END IF
  691. IF ls_count = 1 THEN
  692. SELECT dwname,dname INTO :default_dwname,:default_dname FROM sys_dwnSyntax Where dwname = :fact_print_msg.obj_dwname AND default_flag = 1 ;
  693. IF sqlca.SQLCode = -1 THEN
  694. MessageBox('系统提示','查询单据格式失败'+sqlca.SQLErrText)
  695. RETURN
  696. END IF
  697. IF wf_dwcreate(default_dwname,default_dname,errmsg) = 0 THEN
  698. MessageBox('系统提示','打开单据格式失败!原因:'+errmsg)
  699. RETURN
  700. END IF
  701. dw_1.SetTransObject(sqlca)
  702. ELSEIF ls_count = 0 THEN
  703. END IF
  704. end subroutine
  705. public subroutine wf_subdwpos_strutoblob (s_childreportxwidth arg_s_xwidth, ref blob subdwpos);long ls_clmxp,ls_cmplxp
  706. long i,j
  707. string x_str,width_str,clmxp_str,cmpx_str,cmpwidth_str,cmp_str,subdwstr
  708. //列数
  709. ls_clmxp=arg_s_xwidth.p
  710. if ls_clmxp > 0 then
  711. for i=1 to ls_clmxp
  712. x_str=x_str+string(arg_s_xwidth.x[i])+','
  713. width_str=width_str+string(arg_s_xwidth.width[i])+','
  714. next
  715. x_str=left(x_str,len(x_str) - 1)+';'
  716. width_str=left(width_str,len(width_str) - 1)+';'
  717. clmxp_str='P:'+string(ls_clmxp)+';x:'+x_str+'width:'+width_str
  718. end if
  719. //Messagebox('clmxp_str',clmxp_str)
  720. ls_cmplxp=arg_s_xwidth.cmplp
  721. if ls_cmplxp>0 then
  722. for i= 1 to upperbound(arg_s_xwidth.cmplx)
  723. cmpwidth_str=cmpwidth_str+string(arg_s_xwidth.cmplwidth[i])+','
  724. cmpx_str=cmpx_str+string(arg_s_xwidth.cmplx[i])+','
  725. next
  726. cmpx_str=left(cmpx_str,len(cmpx_str) - 1)+';'
  727. cmpwidth_str=left(cmpwidth_str,len(cmpwidth_str) - 1)+';'
  728. cmp_str='cmplp:'+string(ls_cmplxp)+';x:'+cmpx_str+'width:'+cmpwidth_str
  729. end if
  730. //Messagebox('cmp_str',cmp_str)
  731. //Messagebox('',clmxp_str+cmp_str)
  732. subdwpos=blob(clmxp_str+cmp_str,EncodingANSI!)
  733. //s_subdwxwidth
  734. end subroutine
  735. public subroutine wf_subdwpos_blobtostru (blob arg_blob, ref s_childreportxwidth arg_s_xwidth);//wf_subdwpos_blobtostru(arg_blob,arg_s_xwidth)
  736. string subdwpos_str,clm_str,cmp_str,clm_strx,clm_strwidth,cmplp_x,cmplp_width
  737. long clm_p,cmplp,i
  738. subdwpos_str=string(arg_blob)
  739. if pos(subdwpos_str,'cmplp:') > 0 then
  740. clm_str=mid(subdwpos_str,1,pos(subdwpos_str,'cmplp:') - 1)
  741. else
  742. clm_str=mid(subdwpos_str,1)
  743. end if
  744. cmp_str=mid(subdwpos_str,pos(subdwpos_str,'cmplp:'))
  745. clm_strx=mid(clm_str,pos(clm_str,'x:')+2,pos(clm_str,';width:') - pos(clm_str,'x:') - 1 ) //x_str
  746. clm_strwidth=mid(clm_str,pos(clm_str,'width:') + 6) //width_str
  747. cmplp_x=mid(cmp_str,pos(cmp_str,'x:')+2,pos(cmp_str,';width:') - pos(cmp_str,'x:') - 1 )
  748. cmplp_width=mid(cmp_str,pos(cmp_str,'width:') + 6) //cmplpwidth_str
  749. clm_p=long(mid(clm_str,3,pos(clm_str,';') - 3)) //P
  750. cmplp=long(mid(cmp_str,7,pos(cmp_str,';') - 7)) //cmplp
  751. arg_s_xwidth.p=clm_p
  752. arg_s_xwidth.cmplp=cmplp
  753. //messagebox('all',subdwpos_str)
  754. //MEssagebox('clm_str',clm_str)
  755. //MEssagebox('cmp_str',cmp_str)
  756. //
  757. //MEssagebox('clm_p',clm_p)
  758. //MEssagebox('cmplp',cmplp)
  759. //
  760. //MEssagebox('clm_strx',clm_strx)
  761. //MEssagebox('clm_strwidth',clm_strwidth)
  762. long xmx
  763. string xstr
  764. xmx=0
  765. xstr=''
  766. for i =1 to len(clm_strx) //x
  767. if mid(clm_strx,i,1)<>',' and mid(clm_strx,i,1)<>';' then
  768. xstr=xstr+mid(clm_strx,i,1)
  769. else
  770. xmx++
  771. arg_s_xwidth.x[xmx]=long(xstr)
  772. xstr=''
  773. end if
  774. next
  775. xmx=0
  776. xstr=''
  777. for i =1 to len(clm_strwidth) //width
  778. if mid(clm_strwidth,i,1)<>',' and mid(clm_strwidth,i,1)<>';' then
  779. xstr=xstr+mid(clm_strwidth,i,1)
  780. else
  781. xmx++
  782. arg_s_xwidth.width[xmx]=long(xstr)
  783. xstr=''
  784. end if
  785. next
  786. xmx=0
  787. xstr=''
  788. for i =1 to len(cmplp_x) //cmplp_x
  789. if mid(cmplp_x,i,1)<>',' and mid(cmplp_x,i,1)<>';' then
  790. xstr=xstr+mid(cmplp_x,i,1)
  791. else
  792. xmx++
  793. arg_s_xwidth.cmplx[xmx]=long(xstr)
  794. xstr=''
  795. end if
  796. next
  797. xmx=0
  798. xstr=''
  799. for i =1 to len(cmplp_width) //cmplp_width
  800. if mid(cmplp_width,i,1)<>',' and mid(cmplp_width,i,1)<>';' then
  801. xstr=xstr+mid(cmplp_width,i,1)
  802. else
  803. xmx++
  804. arg_s_xwidth.cmplwidth[xmx]=long(xstr)
  805. xstr=''
  806. end if
  807. next
  808. //messagebox('','sdfsdf')
  809. end subroutine
  810. public function integer wf_read_subdwpos (string arg_dwname, string arg_dname, ref s_childreportxwidth s_subdwwidth, ref string arg_msg);//wf_read_subdwpos(arg_dwname,arg_dname,arg_msg)
  811. blob ls_subdwSyntaxB
  812. int rslt=1
  813. selectblob subdwSyntaxB into :ls_subdwSyntaxB from sys_dwnSyntax where dwname=:arg_dwname and dname=:arg_dname;
  814. if sqlca.sqlcode=-1 then
  815. arg_msg='读取单据明细表格式失败!'+sqlca.sqlerrtext
  816. rslt=0
  817. goto ext
  818. end if
  819. if len(ls_subdwSyntaxB)>0 then
  820. dwod=dw_1.object.mxreport
  821. wf_subdwpos_blobtostru(ls_subdwSyntaxB,s_subdwwidth)
  822. //wf_mdfmxreport(s_subdwwidth)
  823. end if
  824. ext:
  825. return rslt
  826. end function
  827. public subroutine wf_nullrow (long arg_rowcnt, long arg_pagerow, ref long arg_nullrow);//====================================================================
  828. // Function: wf_nullrow()
  829. //--------------------------------------------------------------------
  830. // Description:返回加空行数
  831. //--------------------------------------------------------------------
  832. // Arguments:
  833. // value long arg_rowcnt
  834. // value long arg_pagerow
  835. // reference long arg_nullrow
  836. //--------------------------------------------------------------------
  837. // Returns: (none)
  838. //--------------------------------------------------------------------
  839. // Author: yyx Date: 2004.09.13
  840. //--------------------------------------------------------------------
  841. // Modify History:
  842. //
  843. //====================================================================
  844. Long pagecnt,tal_rowcnt
  845. pagecnt = Long(arg_rowcnt / arg_pagerow)
  846. tal_rowcnt = arg_rowcnt + pagecnt + 1
  847. IF Mod(tal_rowcnt,arg_pagerow) <> 0 THEN
  848. arg_nullrow = arg_pagerow - Mod(tal_rowcnt,arg_pagerow)
  849. ELSE
  850. arg_nullrow = 0
  851. END IF
  852. end subroutine
  853. public subroutine wf_check_ini ();//读取配置
  854. Int li_file_handle
  855. IF NOT FileExists(rpt_inifilename) THEN
  856. li_file_handle = FileOpen(rpt_inifilename ,StreamMode!, Write!, LockWrite!, Append!)
  857. IF li_file_handle <> -1 AND NOT IsNull(li_file_handle) THEN
  858. FileClose(li_file_handle)
  859. END IF
  860. END IF
  861. end subroutine
  862. public subroutine wf_setprofile ();string ls_parm
  863. ls_parm = string(reportid) + '_' + ddlb_printerlist.Text
  864. if isnull(fact_print_msg.ini_group) then return
  865. f_SetProfileString (sys_empid,ls_parm, "margin_top", string(dw_1.object.datawindow.print.margin.top))
  866. f_SetProfileString (sys_empid,ls_parm, "margin_left", string(dw_1.object.datawindow.print.margin.left))
  867. f_SetProfileString (sys_empid,ls_parm, "margin_bottom", string(dw_1.object.datawindow.print.margin.bottom))
  868. f_SetProfileString (sys_empid,ls_parm, "margin_right", string(dw_1.object.datawindow.print.margin.right))
  869. f_SetProfileString (sys_empid,ls_parm, "paper_size", string(dw_1.object.datawindow.print.paper.size) )
  870. f_SetProfileString (sys_empid,ls_parm, "orientation", string(dw_1.object.datawindow.print.orientation))
  871. f_SetProfileString(sys_empid,string(reportid), "dw_default_printer ", dw_default_printer )
  872. f_SetProfileString (sys_empid,ls_parm, "printrow", string(fact_print_msg.printrow))
  873. rslt_printnum++
  874. if fact_print_msg.obj_dwname = 'dw_rp_order_ml_lsx' or fact_print_msg.obj_dwname = 'dw_rp_order_ml_lsx_mg' then
  875. else
  876. cb_exit.triggerevent(clicked!)
  877. end if
  878. end subroutine
  879. public subroutine wf_retrdw_dt ();
  880. datetime firstdate,enddate
  881. firstdate = DateTime(Date(EM_1.Text),Time(0))
  882. enddate = DateTime(Date(EM_2.Text),Time('23:59:59'))
  883. dw_1.Retrieve(firstdate,enddate)
  884. end subroutine
  885. public function integer wf_face_change ();IF fact_print_msg.retr_flag = FALSE THEN
  886. st_4.Visible = TRUE
  887. st_5.Visible = TRUE
  888. EM_1.Visible = TRUE
  889. EM_2.Visible = TRUE
  890. cbx_1.Visible = TRUE
  891. dw_1.Object.datawindow.Print.Preview = 'no'
  892. dw_1.Object.datawindow.Print.Preview.rulers = "no"
  893. ELSE
  894. st_4.Visible = FALSE
  895. st_5.Visible = FALSE
  896. EM_1.Visible = FALSE
  897. EM_2.Visible = FALSE
  898. cbx_1.Visible = FALSE
  899. dw_1.Object.datawindow.Print.Preview = 'yes'
  900. dw_1.Object.datawindow.Print.duplex = 2
  901. dw_1.Object.datawindow.Print.Preview.rulers = "yes"
  902. END IF
  903. RETURN 1
  904. end function
  905. on w_rpt_preview.create
  906. int iCurrent
  907. call super::create
  908. this.st_1=create st_1
  909. this.ddlb_printerlist=create ddlb_printerlist
  910. this.cb_mdfmxrp=create cb_mdfmxrp
  911. this.cb_direcprint=create cb_direcprint
  912. this.ln_bar=create ln_bar
  913. this.ln_bar2=create ln_bar2
  914. this.r_bar=create r_bar
  915. this.cb_3=create cb_3
  916. this.cb_refresh=create cb_refresh
  917. this.cb_indirectprint=create cb_indirectprint
  918. this.st_2=create st_2
  919. this.st_3=create st_3
  920. this.st_4=create st_4
  921. this.st_5=create st_5
  922. this.em_1=create em_1
  923. this.em_2=create em_2
  924. this.cbx_1=create cbx_1
  925. this.dw_1=create dw_1
  926. this.ln_1=create ln_1
  927. this.ln_2=create ln_2
  928. iCurrent=UpperBound(this.Control)
  929. this.Control[iCurrent+1]=this.st_1
  930. this.Control[iCurrent+2]=this.ddlb_printerlist
  931. this.Control[iCurrent+3]=this.cb_mdfmxrp
  932. this.Control[iCurrent+4]=this.cb_direcprint
  933. this.Control[iCurrent+5]=this.ln_bar
  934. this.Control[iCurrent+6]=this.ln_bar2
  935. this.Control[iCurrent+7]=this.r_bar
  936. this.Control[iCurrent+8]=this.cb_3
  937. this.Control[iCurrent+9]=this.cb_refresh
  938. this.Control[iCurrent+10]=this.cb_indirectprint
  939. this.Control[iCurrent+11]=this.st_2
  940. this.Control[iCurrent+12]=this.st_3
  941. this.Control[iCurrent+13]=this.st_4
  942. this.Control[iCurrent+14]=this.st_5
  943. this.Control[iCurrent+15]=this.em_1
  944. this.Control[iCurrent+16]=this.em_2
  945. this.Control[iCurrent+17]=this.cbx_1
  946. this.Control[iCurrent+18]=this.dw_1
  947. this.Control[iCurrent+19]=this.ln_1
  948. this.Control[iCurrent+20]=this.ln_2
  949. end on
  950. on w_rpt_preview.destroy
  951. call super::destroy
  952. destroy(this.st_1)
  953. destroy(this.ddlb_printerlist)
  954. destroy(this.cb_mdfmxrp)
  955. destroy(this.cb_direcprint)
  956. destroy(this.ln_bar)
  957. destroy(this.ln_bar2)
  958. destroy(this.r_bar)
  959. destroy(this.cb_3)
  960. destroy(this.cb_refresh)
  961. destroy(this.cb_indirectprint)
  962. destroy(this.st_2)
  963. destroy(this.st_3)
  964. destroy(this.st_4)
  965. destroy(this.st_5)
  966. destroy(this.em_1)
  967. destroy(this.em_2)
  968. destroy(this.cbx_1)
  969. destroy(this.dw_1)
  970. destroy(this.ln_1)
  971. destroy(this.ln_2)
  972. end on
  973. event open;call super::open;String ls_parm
  974. Blob lblob
  975. String errmsg
  976. String ls_dw
  977. EM_1.Text = String(Today(),'yyyy-mm')+'-01'
  978. EM_2.Text = String(Today(),'YYYY-MM-DD')
  979. //初始化打印机
  980. wf_initprinterinfo()
  981. ///////////////////////
  982. fact_print_msg = Message.PowerObjectParm
  983. retrieveid = fact_print_msg.retr_pramnmb
  984. scid = fact_print_msg.retr_scid
  985. reportid = fact_print_msg.rpid
  986. st_1.Text = fact_print_msg.tag_text
  987. st_3.Text = fact_print_msg.rpname
  988. IF fact_print_msg.isdw <> '' THEN
  989. ls_dw = fact_print_msg.isdw
  990. ELSE
  991. //获取DW数据
  992. SELECTBLOB Rpsyntax INTO :lblob FROM u_report_list Where rpid = :reportid USING sqlca;
  993. IF sqlca.SQLCode = 0 THEN
  994. ls_dw = String(lblob)
  995. END IF
  996. END IF
  997. dw_1.Create(ls_dw,errmsg)
  998. IF errmsg > '' THEN
  999. POST MessageBox("出错信息","创建数据窗口时出错:"+errmsg)
  1000. RETURN
  1001. END IF
  1002. //检查配置文件
  1003. wf_check_ini()
  1004. dw_default_printer = f_ProfileString (sys_empid,String(reportid), "dw_default_printer ", "" )
  1005. IF dw_default_printer = '' THEN
  1006. ddlb_printerlist.Text = default_printer
  1007. ELSE
  1008. ddlb_printerlist.Text = dw_default_printer
  1009. END IF
  1010. ls_parm = String(reportid) + '_' + ddlb_printerlist.Text
  1011. printrow = Long(f_ProfileString (sys_empid,ls_parm, "printrow", '10'))
  1012. fact_print_msg.printrow = printrow
  1013. dw_1.SetTransObject(sqlca)
  1014. wf_face_change()
  1015. /////////自定义单据格式相关
  1016. IF fact_print_msg.retr_flag = TRUE AND fact_print_msg.retr_pram_falg <> -1 THEN
  1017. f_retrieve_dw(dw_1,fact_print_msg)
  1018. ELSEIF fact_print_msg.retr_flag = FALSE THEN
  1019. wf_retrdw_dt()
  1020. END IF
  1021. dw_1.SetRedraw(FALSE)
  1022. dw_1.Object.datawindow.Print.margin.Top = Integer(f_ProfileString (sys_empid,ls_parm, "margin_top", "30"))
  1023. dw_1.Object.datawindow.Print.margin.Left = Integer(f_ProfileString (sys_empid,ls_parm, "margin_left", "20" ))
  1024. dw_1.Object.datawindow.Print.margin.bottom = Integer(f_ProfileString (sys_empid,ls_parm, "margin_bottom", "30"))
  1025. dw_1.Object.datawindow.Print.margin.Right = Integer(f_ProfileString (sys_empid,ls_parm, "margin_right", "20" ))
  1026. dw_1.Object.datawindow.Print.paper.size = Integer(f_ProfileString (sys_empid,ls_parm, "paper_size", "9" ))
  1027. IF fact_print_msg.retr_flag = TRUE THEN
  1028. dw_1.Object.datawindow.Print.orientation = Integer(f_ProfileString (sys_empid,ls_parm, "orientation", "0" ))
  1029. ELSE
  1030. dw_1.Object.datawindow.Print.orientation = Integer(f_ProfileString (sys_empid,ls_parm, "orientation", "1" ))
  1031. END IF
  1032. dw_1.SetRedraw(TRUE)
  1033. end event
  1034. event resize;dw_1.setredraw(false)
  1035. ln_bar.endx = this.width
  1036. ln_bar2.endx = this.width
  1037. ln_1.endx = this.width
  1038. ln_2.endx = this.width
  1039. r_bar.width = this.width
  1040. DW_1.WIDTH=THIS.WIDTH - DW_1.X - 35
  1041. DW_1.HEIGHT=THIS.HEIGHT - DW_1.Y - 200
  1042. dw_1.setredraw(true)
  1043. end event
  1044. event close;call super::close;closewithreturn(this,rslt_printnum)
  1045. end event
  1046. type cb_exit from w_rpt_publ_base`cb_exit within w_rpt_preview
  1047. integer x = 850
  1048. integer width = 151
  1049. integer height = 164
  1050. integer picsize = 16
  1051. toolbaralignment pic_align = alignattop!
  1052. boolean border = false
  1053. end type
  1054. type st_1 from statictext within w_rpt_preview
  1055. integer x = 1216
  1056. integer y = 56
  1057. integer width = 754
  1058. integer height = 60
  1059. integer textsize = -9
  1060. integer weight = 700
  1061. fontcharset fontcharset = gb2312charset!
  1062. fontpitch fontpitch = variable!
  1063. string facename = "宋体"
  1064. long backcolor = 67108864
  1065. string text = "标题"
  1066. boolean focusrectangle = false
  1067. end type
  1068. event constructor;this.backcolor = 14215660
  1069. end event
  1070. type ddlb_printerlist from dropdownlistbox within w_rpt_preview
  1071. integer x = 370
  1072. integer y = 184
  1073. integer width = 1312
  1074. integer height = 1380
  1075. integer taborder = 110
  1076. boolean bringtotop = true
  1077. integer textsize = -9
  1078. integer weight = 400
  1079. fontcharset fontcharset = gb2312charset!
  1080. fontpitch fontpitch = variable!
  1081. string facename = "宋体"
  1082. long textcolor = 33554432
  1083. boolean autohscroll = true
  1084. boolean vscrollbar = true
  1085. borderstyle borderstyle = stylelowered!
  1086. end type
  1087. event selectionchanged;String ls_parm
  1088. ls_parm = string(reportid) + '_' + ddlb_printerlist.Text
  1089. dw_1.SetRedraw(FALSE)
  1090. dw_1.Object.datawindow.Print.margin.Top = Integer(f_ProfileString (sys_empid,ls_parm, "margin_top", "30"))
  1091. dw_1.Object.datawindow.Print.margin.Left = Integer(f_ProfileString (sys_empid,ls_parm, "margin_left", "30" ))
  1092. dw_1.Object.datawindow.Print.margin.bottom = Integer(f_ProfileString (sys_empid,ls_parm, "margin_bottom", "30"))
  1093. dw_1.Object.datawindow.Print.margin.Right = Integer(f_ProfileString (sys_empid,ls_parm, "margin_right", "30" ))
  1094. dw_1.Object.datawindow.Print.paper.size = Integer(f_ProfileString (sys_empid,ls_parm, "paper_size", "9" ))
  1095. dw_1.Object.datawindow.Print.orientation = Integer(f_ProfileString (sys_empid,ls_parm, "orientation", "0" ))
  1096. dw_1.SetRedraw(TRUE)
  1097. end event
  1098. type cb_mdfmxrp from commandbutton within w_rpt_preview
  1099. boolean visible = false
  1100. integer x = 261
  1101. integer y = 496
  1102. integer width = 379
  1103. integer height = 92
  1104. integer taborder = 40
  1105. integer textsize = -9
  1106. integer weight = 400
  1107. fontcharset fontcharset = gb2312charset!
  1108. fontpitch fontpitch = variable!
  1109. string facename = "宋体"
  1110. string text = "明细网格调整"
  1111. end type
  1112. event clicked;dwod=dw_1.object.mxreport
  1113. s_mdfxwidth_tran s_mdfxw_tran
  1114. s_mdfxw_tran.retrievetype = fact_print_msg.retr_pram_falg
  1115. s_mdfxw_tran.retrieveid=retrieveid
  1116. ///////////yyx0821
  1117. //if em_1.enabled then
  1118. // secondretrieveid=long(em_1.text)
  1119. //else
  1120. // secondretrieveid = sys_scid
  1121. //end if
  1122. ///////////
  1123. s_mdfxw_tran.secondretrieveid=secondretrieveid
  1124. s_mdfxw_tran.retrievestr=fact_print_msg.retr_pramstr
  1125. s_mdfxw_tran.dataobject=dwod.dataobject
  1126. openwithparm(w_publ_preview_mdfcrptxwidth,s_mdfxw_tran)
  1127. s_xwidth=message.powerobjectparm
  1128. //write ini
  1129. //wf_write_childdw_pos(s_mdfxw_tran.dataobject,s_xwidth)
  1130. //
  1131. wf_mdfmxreport(s_xwidth)
  1132. end event
  1133. type cb_direcprint from uo_imflatbutton within w_rpt_preview
  1134. integer x = 302
  1135. integer width = 274
  1136. integer height = 164
  1137. integer taborder = 120
  1138. boolean bringtotop = true
  1139. string text = "直接打印"
  1140. boolean default = true
  1141. string normalpicname = "print.bmp"
  1142. integer picsize = 16
  1143. toolbaralignment pic_align = alignattop!
  1144. boolean border = false
  1145. end type
  1146. event clicked;call super::clicked;//if cbx_select_page.checked then
  1147. // dw_default_printer = ddlb_printerlist.text
  1148. // lnv_printer.of_setdefault ( dw_default_printer )
  1149. // openwithparm(w_sys_printpagesetting,dw_1)
  1150. // wf_setdefaultprinter()
  1151. //else
  1152. dw_default_printer = ddlb_printerlist.text
  1153. lnv_printer.of_setdefault ( dw_default_printer )
  1154. dw_1.print()
  1155. wf_setdefaultprinter()
  1156. //end if
  1157. wf_setprofile()
  1158. end event
  1159. type ln_bar from line within w_rpt_preview
  1160. long linecolor = 268435456
  1161. integer linethickness = 4
  1162. integer beginy = 168
  1163. integer endx = 3406
  1164. integer endy = 168
  1165. end type
  1166. type ln_bar2 from line within w_rpt_preview
  1167. long linecolor = 16777215
  1168. integer linethickness = 4
  1169. integer beginy = 172
  1170. integer endx = 3406
  1171. integer endy = 172
  1172. end type
  1173. type r_bar from rectangle within w_rpt_preview
  1174. long linecolor = 16777215
  1175. long fillcolor = 1073741824
  1176. integer x = 2747
  1177. integer width = 73
  1178. integer height = 172
  1179. end type
  1180. event constructor;this.fillcolor = 14215660
  1181. this.linecolor = 14215660
  1182. this.x = -1
  1183. this.y = -1
  1184. this.height = ln_bar2.beginy - 5
  1185. end event
  1186. type cb_3 from uo_imflatbutton within w_rpt_preview
  1187. integer x = 151
  1188. integer width = 151
  1189. integer height = 164
  1190. integer taborder = 110
  1191. string text = "功能"
  1192. string normalpicname = "setting.bmp"
  1193. integer picsize = 16
  1194. toolbaralignment pic_align = alignattop!
  1195. boolean border = false
  1196. end type
  1197. event clicked;call super::clicked;
  1198. m_Dfc_Control_PopupMenu dmPopupMenu
  1199. String menustr
  1200. IF fact_print_msg.retr_flag OR cbx_1.Checked THEN
  1201. menustr = menustr + "Text=页面设置~tEvent=ue_setprintpage_value" + "|"
  1202. END IF
  1203. menustr = menustr + "Text=数据发送~tEvent=ue_sentdataout"
  1204. menustr = menustr + "|" + "Text=-"
  1205. menustr = menustr + "|" + "Text=上一页~tEvent=ue_spp"
  1206. menustr = menustr + "|" + "Text=下一页~tEvent=ue_snp"
  1207. IF Len(Trim(menustr)) <> 0 THEN
  1208. dmPopupMenu = CREATE m_Dfc_Control_PopupMenu
  1209. dmPopupMenu.mf_BuildMenu(THIS, menustr)
  1210. dmPopupMenu.mf_PopMenu()
  1211. DESTROY dmPopupMenu
  1212. END IF
  1213. end event
  1214. type cb_refresh from uo_imflatbutton within w_rpt_preview
  1215. integer width = 151
  1216. integer height = 164
  1217. integer taborder = 110
  1218. string text = "重查"
  1219. string normalpicname = "refresh.bmp"
  1220. integer picsize = 16
  1221. toolbaralignment pic_align = alignattop!
  1222. boolean border = false
  1223. end type
  1224. event clicked;call super::clicked;
  1225. IF fact_print_msg.retr_flag = TRUE THEN
  1226. f_retrieve_dw(dw_1,fact_print_msg)
  1227. ELSE
  1228. wf_retrdw_dt()
  1229. END IF
  1230. end event
  1231. type cb_indirectprint from uo_imflatbutton within w_rpt_preview
  1232. integer x = 576
  1233. integer width = 274
  1234. integer height = 164
  1235. integer taborder = 130
  1236. boolean bringtotop = true
  1237. string text = "选页打印"
  1238. string normalpicname = "print.bmp"
  1239. integer picsize = 16
  1240. toolbaralignment pic_align = alignattop!
  1241. boolean border = false
  1242. end type
  1243. event clicked;call super::clicked;//if cbx_select_page.checked then
  1244. dw_default_printer = ddlb_printerlist.text
  1245. lnv_printer.of_setdefault ( dw_default_printer )
  1246. openwithparm(w_sys_printpagesetting,dw_1)
  1247. wf_setdefaultprinter()
  1248. //else
  1249. // dw_default_printer = ddlb_printerlist.text
  1250. // lnv_printer.of_setdefault ( dw_default_printer )
  1251. // dw_1.print()
  1252. // wf_setdefaultprinter()
  1253. //end if
  1254. wf_setprofile()
  1255. end event
  1256. type st_2 from statictext within w_rpt_preview
  1257. integer x = 37
  1258. integer y = 196
  1259. integer width = 320
  1260. integer height = 64
  1261. boolean bringtotop = true
  1262. integer textsize = -9
  1263. integer weight = 400
  1264. fontcharset fontcharset = gb2312charset!
  1265. fontpitch fontpitch = variable!
  1266. string facename = "宋体"
  1267. long textcolor = 33554432
  1268. long backcolor = 134217739
  1269. string text = "打印机列表:"
  1270. boolean focusrectangle = false
  1271. end type
  1272. type st_3 from statictext within w_rpt_preview
  1273. integer x = 2085
  1274. integer y = 56
  1275. integer width = 754
  1276. integer height = 60
  1277. boolean bringtotop = true
  1278. integer textsize = -9
  1279. integer weight = 700
  1280. fontcharset fontcharset = gb2312charset!
  1281. fontpitch fontpitch = variable!
  1282. string facename = "宋体"
  1283. long backcolor = 67108864
  1284. boolean focusrectangle = false
  1285. end type
  1286. event constructor;this.backcolor = 14215660
  1287. end event
  1288. type st_4 from statictext within w_rpt_preview
  1289. integer x = 2258
  1290. integer y = 196
  1291. integer width = 229
  1292. integer height = 64
  1293. boolean bringtotop = true
  1294. integer textsize = -9
  1295. integer weight = 400
  1296. fontcharset fontcharset = gb2312charset!
  1297. fontpitch fontpitch = variable!
  1298. string facename = "宋体"
  1299. long textcolor = 33554432
  1300. long backcolor = 134217739
  1301. string text = "日期从:"
  1302. alignment alignment = right!
  1303. boolean focusrectangle = false
  1304. end type
  1305. type st_5 from statictext within w_rpt_preview
  1306. integer x = 2917
  1307. integer y = 196
  1308. integer width = 101
  1309. integer height = 64
  1310. boolean bringtotop = true
  1311. integer textsize = -9
  1312. integer weight = 400
  1313. fontcharset fontcharset = gb2312charset!
  1314. fontpitch fontpitch = variable!
  1315. string facename = "宋体"
  1316. long textcolor = 33554432
  1317. long backcolor = 134217739
  1318. string text = "到"
  1319. boolean focusrectangle = false
  1320. end type
  1321. type em_1 from editmask within w_rpt_preview
  1322. integer x = 2496
  1323. integer y = 184
  1324. integer width = 402
  1325. integer height = 84
  1326. integer taborder = 120
  1327. boolean bringtotop = true
  1328. integer textsize = -9
  1329. integer weight = 400
  1330. fontcharset fontcharset = gb2312charset!
  1331. fontpitch fontpitch = variable!
  1332. string facename = "宋体"
  1333. long textcolor = 33554432
  1334. string text = "none"
  1335. borderstyle borderstyle = stylelowered!
  1336. maskdatatype maskdatatype = datetimemask!
  1337. string mask = "yyyy-mm-dd"
  1338. boolean spin = true
  1339. end type
  1340. event rbuttondown;s_calender_arg s_calender
  1341. s_calender.PointerX = THIS.PointerX()
  1342. s_calender.PointerY = THIS.PointerY()
  1343. s_calender.X = THIS.X
  1344. s_calender.Y = THIS.Y
  1345. OpenWithParm(w_calendar,s_calender)
  1346. THIS.Text = String(id_date_selected)
  1347. end event
  1348. type em_2 from editmask within w_rpt_preview
  1349. integer x = 2981
  1350. integer y = 184
  1351. integer width = 402
  1352. integer height = 84
  1353. integer taborder = 130
  1354. boolean bringtotop = true
  1355. integer textsize = -9
  1356. integer weight = 400
  1357. fontcharset fontcharset = gb2312charset!
  1358. fontpitch fontpitch = variable!
  1359. string facename = "宋体"
  1360. long textcolor = 33554432
  1361. string text = "none"
  1362. borderstyle borderstyle = stylelowered!
  1363. maskdatatype maskdatatype = datetimemask!
  1364. string mask = "yyyy-mm-dd"
  1365. boolean spin = true
  1366. end type
  1367. event rbuttondown;s_calender_arg s_calender
  1368. s_calender.PointerX = THIS.PointerX()
  1369. s_calender.PointerY = THIS.PointerY()
  1370. s_calender.X = THIS.X
  1371. s_calender.Y = THIS.Y
  1372. OpenWithParm(w_calendar,s_calender)
  1373. THIS.Text = String(id_date_selected)
  1374. end event
  1375. type cbx_1 from checkbox within w_rpt_preview
  1376. integer x = 1957
  1377. integer y = 192
  1378. integer width = 279
  1379. integer height = 64
  1380. boolean bringtotop = true
  1381. integer textsize = -9
  1382. integer weight = 400
  1383. fontcharset fontcharset = gb2312charset!
  1384. fontpitch fontpitch = variable!
  1385. string facename = "宋体"
  1386. long textcolor = 33554432
  1387. long backcolor = 134217739
  1388. string text = "预览"
  1389. end type
  1390. event clicked;IF THIS.Checked THEN
  1391. dw_1.Object.datawindow.Print.Preview = 'yes'
  1392. dw_1.Object.datawindow.Print.duplex = 2
  1393. dw_1.Object.datawindow.Print.Preview.rulers = "yes"
  1394. ELSE
  1395. dw_1.Object.datawindow.Print.Preview = 'no'
  1396. dw_1.Object.datawindow.Print.Preview.rulers = "no"
  1397. END IF
  1398. end event
  1399. type dw_1 from u_rpt_dw_rbtnfilter within w_rpt_preview
  1400. integer y = 288
  1401. integer width = 3401
  1402. integer height = 1508
  1403. integer taborder = 20
  1404. boolean bringtotop = true
  1405. string dataobject = "dw_rpt_print"
  1406. boolean hscrollbar = true
  1407. boolean vscrollbar = true
  1408. boolean rbutton_filter_use = true
  1409. boolean titleclick_sort_use = true
  1410. end type
  1411. event doubleclicked;call super::doubleclicked;if dwo.type='datawindow' then return
  1412. s_preview_dwoprp_tran S_SREU
  1413. S_SREU.yn=0
  1414. S_SREU.x=integer(dwo.x)
  1415. S_SREU.y=integer(dwo.y)
  1416. S_SREU.width=integer(dwo.width)
  1417. S_SREU.height=integer(dwo.height)
  1418. S_SREU.dwotype=dwo.type
  1419. S_SREU.dwoname=DWO.NAME
  1420. if LOWER(LEFT(dwo.type,4))='text' then
  1421. S_SREU.dwotext=dwo.TEXT
  1422. else
  1423. S_SREU.dwotext=''
  1424. end if
  1425. openwithparm(w_rpt_preview_setdwoprp,S_SREU)
  1426. S_SREU=Message.PowerObjectParm
  1427. if S_SREU.yn=1 then
  1428. dwo.x=S_SREU.x
  1429. dwo.y=S_SREU.y
  1430. dwo.width=S_SREU.width
  1431. dwo.height=S_SREU.height
  1432. if LOWER(LEFT(dwo.type,4))='text' then
  1433. THIS.Modify(dwo.name+'.text="'+S_SREU.dwotext+'"')
  1434. // dwo.TEXT=S_SREU.dwotext
  1435. end if
  1436. end if
  1437. end event
  1438. type ln_1 from line within w_rpt_preview
  1439. long linecolor = 268435456
  1440. integer linethickness = 4
  1441. integer beginy = 276
  1442. integer endx = 3406
  1443. integer endy = 276
  1444. end type
  1445. type ln_2 from line within w_rpt_preview
  1446. long linecolor = 16777215
  1447. integer linethickness = 4
  1448. integer beginy = 280
  1449. integer endx = 3406
  1450. integer endy = 280
  1451. end type