w_rpt_setup.srw 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. $PBExportHeader$w_rpt_setup.srw
  2. $PBExportComments$打印纸设置--窗口
  3. forward
  4. global type w_rpt_setup from w_rpt_base
  5. end type
  6. type em_size from editmask within w_rpt_setup
  7. end type
  8. type st_4 from statictext within w_rpt_setup
  9. end type
  10. type st_3 from statictext within w_rpt_setup
  11. end type
  12. type st_papersize from statictext within w_rpt_setup
  13. end type
  14. type st_paperlist from statictext within w_rpt_setup
  15. end type
  16. type st_03 from statictext within w_rpt_setup
  17. end type
  18. type cb_1 from commandbutton within w_rpt_setup
  19. end type
  20. type cb_2 from commandbutton within w_rpt_setup
  21. end type
  22. type gb_11 from groupbox within w_rpt_setup
  23. end type
  24. type gb_3 from groupbox within w_rpt_setup
  25. end type
  26. type gb_2 from groupbox within w_rpt_setup
  27. end type
  28. type rb_5 from radiobutton within w_rpt_setup
  29. end type
  30. type rb_6 from radiobutton within w_rpt_setup
  31. end type
  32. type st_1 from statictext within w_rpt_setup
  33. end type
  34. type st_2 from statictext within w_rpt_setup
  35. end type
  36. type em_1 from editmask within w_rpt_setup
  37. end type
  38. type em_2 from editmask within w_rpt_setup
  39. end type
  40. type em_3 from editmask within w_rpt_setup
  41. end type
  42. type cb_20 from commandbutton within w_rpt_setup
  43. end type
  44. type rb_4 from radiobutton within w_rpt_setup
  45. end type
  46. type cbx_1 from checkbox within w_rpt_setup
  47. end type
  48. type rb_11 from radiobutton within w_rpt_setup
  49. end type
  50. type rb_12 from radiobutton within w_rpt_setup
  51. end type
  52. type em_01 from editmask within w_rpt_setup
  53. end type
  54. type em_02 from editmask within w_rpt_setup
  55. end type
  56. type st_01 from statictext within w_rpt_setup
  57. end type
  58. type gb_1 from groupbox within w_rpt_setup
  59. end type
  60. type ddlb_size from dropdownlistbox within w_rpt_setup
  61. end type
  62. type st_02 from statictext within w_rpt_setup
  63. end type
  64. type cbx_2 from checkbox within w_rpt_setup
  65. end type
  66. type em_03 from editmask within w_rpt_setup
  67. end type
  68. type cbx_3 from checkbox within w_rpt_setup
  69. end type
  70. end forward
  71. global type w_rpt_setup from w_rpt_base
  72. integer x = 553
  73. integer y = 532
  74. integer width = 2587
  75. integer height = 888
  76. string title = "打印参数设置窗口"
  77. boolean minbox = false
  78. boolean maxbox = false
  79. boolean resizable = false
  80. windowtype windowtype = response!
  81. windowstate windowstate = normal!
  82. em_size em_size
  83. st_4 st_4
  84. st_3 st_3
  85. st_papersize st_papersize
  86. st_paperlist st_paperlist
  87. st_03 st_03
  88. cb_1 cb_1
  89. cb_2 cb_2
  90. gb_11 gb_11
  91. gb_3 gb_3
  92. gb_2 gb_2
  93. rb_5 rb_5
  94. rb_6 rb_6
  95. st_1 st_1
  96. st_2 st_2
  97. em_1 em_1
  98. em_2 em_2
  99. em_3 em_3
  100. cb_20 cb_20
  101. rb_4 rb_4
  102. cbx_1 cbx_1
  103. rb_11 rb_11
  104. rb_12 rb_12
  105. em_01 em_01
  106. em_02 em_02
  107. st_01 st_01
  108. gb_1 gb_1
  109. ddlb_size ddlb_size
  110. st_02 st_02
  111. cbx_2 cbx_2
  112. em_03 em_03
  113. cbx_3 cbx_3
  114. end type
  115. global w_rpt_setup w_rpt_setup
  116. type prototypes
  117. //Function int SetPaperSize(uint Width,uint Height,uint Orient) Library "mHand.dll"
  118. function boolean IsWindowsNT() library "PrintCtrl.dll"
  119. SUBROUTINE About() library "PrintCtrl.dll"
  120. function boolean GetDefaultPrinter(ref string PrinterName, int BufferLen) library "PrintCtrl.dll" alias for "GetDefaultPrinter;Ansi"
  121. function boolean GetPrinterPort(ref string PrinterName, ref string Port, int PortLen, ref string Driver, int DriverLen) library "PrintCtrl.dll" alias for "GetPrinterPort;Ansi"
  122. function boolean GetPrinterList(ref string PrinterList, ref long bufferLen) library "PrintCtrl.dll" alias for "GetPrinterList;Ansi"
  123. function boolean GetPrinterStatus(ref string Printer, ref long status) library "PrintCtrl.dll" alias for "GetPrinterStatus;Ansi"
  124. function boolean GetPaperList(ref string Printer, ref string PaperList, ref long bufferLen) library "PrintCtrl.dll" alias for "GetPaperList;Ansi"
  125. function boolean SetPrinterDefault(ref string Printer) library "PrintCtrl.dll" alias for "SetPrinterDefault;Ansi"
  126. function boolean AddCustomPaper( ref string Printer, ref string PaperName, long pwidth, long pheight, long left, long right, long top, long bottom) library "PrintCtrl.dll" alias for "AddCustomPaper;Ansi"
  127. function boolean DeleteCustomPaper(ref string Printer, ref string PaperName) library "PrintCtrl.dll" alias for "DeleteCustomPaper;Ansi"
  128. function boolean SetUserDefinePaper(ref string Printer, ref long pWidth, ref long pHeight) library "PrintCtrl.dll" alias for "SetUserDefinePaper;Ansi"
  129. function boolean GetUserDefinePaperMinMax(ref string Printer, ref long minWidth, ref long minHeight, ref long maxWidth, ref long maxHeight) library "PrintCtrl.dll" alias for "GetUserDefinePaperMinMax;Ansi"
  130. function boolean GetDefaultPaper(ref string Printer, ref string PaperName, ref int nOrientation) library "PrintCtrl.dll" alias for "GetDefaultPaper;Ansi"
  131. function boolean SetDefaultPaper(ref string Printer, ref string PaperName, int nOrientation) library "PrintCtrl.dll" alias for "SetDefaultPaper;Ansi"
  132. function boolean GetDefaultPaper(ref string Printer, ref string PaperName,ref long nPapserSize, ref long nOrientation) library "PrintCtrl.dll" alias for "GetDefaultPaper;Ansi"
  133. function boolean GetPaperName(ref string Printer, ref string PaperName, int PaperSize) library "PrintCtrl.dll" alias for "GetPaperName;Ansi"
  134. function boolean GetPaperSize(ref string Printer, ref string PaperName, ref int PaperSize) library "PrintCtrl.dll" alias for "GetPaperSize;Ansi"
  135. function boolean GetBinNameList(ref string Printer, ref string BinNameList) library "PrintCtrl.dll" alias for "GetBinNameList;Ansi"
  136. function boolean GetBin(ref string Printer, ref string BinName, ref int Bin) library "PrintCtrl.dll" alias for "GetBin;Ansi"
  137. function boolean GetBinName(ref string Printer, ref string BinName, int Bin) library "PrintCtrl.dll" alias for "GetBinName;Ansi"
  138. end prototypes
  139. type variables
  140. string is_setup,is_range,is_size,is_pwidth,is_phigh
  141. int ii_percent
  142. datawindow dw1,dw2
  143. string dft_printername
  144. end variables
  145. forward prototypes
  146. public subroutine wf_getpaperlist ()
  147. public subroutine wf_getpapersize ()
  148. end prototypes
  149. public subroutine wf_getpaperlist ();String printerName
  150. String paperList
  151. Long bufferlen = 0
  152. Boolean rt
  153. Long p1,p2
  154. p1 = 1
  155. p2 = 0
  156. printerName = dft_printername
  157. IF printerName = "" THEN
  158. st_paperlist.Text = "请选择一个打印机!"
  159. RETURN
  160. END IF
  161. ddlb_size.AddItem('[默认]')
  162. rt = GetPaperList(REF printerName, REF paperList, REF bufferlen)
  163. If (NOT rt) AND bufferlen > 0 THEN
  164. paperList = Space(bufferlen)
  165. rt = GetPaperList(REF printerName, REF paperList, REF bufferlen)
  166. IF rt THEN
  167. p2 = Pos(paperList,"~t",p1)
  168. DO WHILE p2 > 0
  169. string ls_papername
  170. ls_papername = Mid(paperList,p1,p2 - p1)
  171. ddlb_size.AddItem(ls_papername)
  172. Int size = 0
  173. boolean lb_rt
  174. lb_rt = GetPaperSize(REF printername, REF ls_papername, REF size)
  175. if is_size = string(size) then
  176. ddlb_size.text = ls_papername
  177. end if
  178. p1 = p2+1
  179. p2 = Pos(paperList,"~t",p1)
  180. LOOP
  181. END IF
  182. ELSE
  183. st_paperlist.Text = "调用函数出错!"
  184. END IF
  185. ddlb_size.AddItem('自定义纸')
  186. end subroutine
  187. public subroutine wf_getpapersize ();String printername
  188. String papername
  189. Boolean rt
  190. if ddlb_size.text = '[默认]' then
  191. em_size.Text = '0'
  192. return
  193. end if
  194. printername = dft_printername
  195. IF printername = "" THEN
  196. st_papersize.Text = "请选择一个打印机!"
  197. RETURN
  198. END IF
  199. papername = ddlb_size.text
  200. IF papername = "" THEN
  201. st_papersize.Text = "请选择一个纸张!"
  202. RETURN
  203. END IF
  204. Int size = 0
  205. rt = GetPaperSize(REF printername, REF papername, REF size)
  206. IF rt THEN
  207. em_size.Text = String(size)
  208. ELSE
  209. st_papersize.Text = "函数调用错误"
  210. END IF
  211. end subroutine
  212. on w_rpt_setup.create
  213. int iCurrent
  214. call super::create
  215. this.em_size=create em_size
  216. this.st_4=create st_4
  217. this.st_3=create st_3
  218. this.st_papersize=create st_papersize
  219. this.st_paperlist=create st_paperlist
  220. this.st_03=create st_03
  221. this.cb_1=create cb_1
  222. this.cb_2=create cb_2
  223. this.gb_11=create gb_11
  224. this.gb_3=create gb_3
  225. this.gb_2=create gb_2
  226. this.rb_5=create rb_5
  227. this.rb_6=create rb_6
  228. this.st_1=create st_1
  229. this.st_2=create st_2
  230. this.em_1=create em_1
  231. this.em_2=create em_2
  232. this.em_3=create em_3
  233. this.cb_20=create cb_20
  234. this.rb_4=create rb_4
  235. this.cbx_1=create cbx_1
  236. this.rb_11=create rb_11
  237. this.rb_12=create rb_12
  238. this.em_01=create em_01
  239. this.em_02=create em_02
  240. this.st_01=create st_01
  241. this.gb_1=create gb_1
  242. this.ddlb_size=create ddlb_size
  243. this.st_02=create st_02
  244. this.cbx_2=create cbx_2
  245. this.em_03=create em_03
  246. this.cbx_3=create cbx_3
  247. iCurrent=UpperBound(this.Control)
  248. this.Control[iCurrent+1]=this.em_size
  249. this.Control[iCurrent+2]=this.st_4
  250. this.Control[iCurrent+3]=this.st_3
  251. this.Control[iCurrent+4]=this.st_papersize
  252. this.Control[iCurrent+5]=this.st_paperlist
  253. this.Control[iCurrent+6]=this.st_03
  254. this.Control[iCurrent+7]=this.cb_1
  255. this.Control[iCurrent+8]=this.cb_2
  256. this.Control[iCurrent+9]=this.gb_11
  257. this.Control[iCurrent+10]=this.gb_3
  258. this.Control[iCurrent+11]=this.gb_2
  259. this.Control[iCurrent+12]=this.rb_5
  260. this.Control[iCurrent+13]=this.rb_6
  261. this.Control[iCurrent+14]=this.st_1
  262. this.Control[iCurrent+15]=this.st_2
  263. this.Control[iCurrent+16]=this.em_1
  264. this.Control[iCurrent+17]=this.em_2
  265. this.Control[iCurrent+18]=this.em_3
  266. this.Control[iCurrent+19]=this.cb_20
  267. this.Control[iCurrent+20]=this.rb_4
  268. this.Control[iCurrent+21]=this.cbx_1
  269. this.Control[iCurrent+22]=this.rb_11
  270. this.Control[iCurrent+23]=this.rb_12
  271. this.Control[iCurrent+24]=this.em_01
  272. this.Control[iCurrent+25]=this.em_02
  273. this.Control[iCurrent+26]=this.st_01
  274. this.Control[iCurrent+27]=this.gb_1
  275. this.Control[iCurrent+28]=this.ddlb_size
  276. this.Control[iCurrent+29]=this.st_02
  277. this.Control[iCurrent+30]=this.cbx_2
  278. this.Control[iCurrent+31]=this.em_03
  279. this.Control[iCurrent+32]=this.cbx_3
  280. end on
  281. on w_rpt_setup.destroy
  282. call super::destroy
  283. destroy(this.em_size)
  284. destroy(this.st_4)
  285. destroy(this.st_3)
  286. destroy(this.st_papersize)
  287. destroy(this.st_paperlist)
  288. destroy(this.st_03)
  289. destroy(this.cb_1)
  290. destroy(this.cb_2)
  291. destroy(this.gb_11)
  292. destroy(this.gb_3)
  293. destroy(this.gb_2)
  294. destroy(this.rb_5)
  295. destroy(this.rb_6)
  296. destroy(this.st_1)
  297. destroy(this.st_2)
  298. destroy(this.em_1)
  299. destroy(this.em_2)
  300. destroy(this.em_3)
  301. destroy(this.cb_20)
  302. destroy(this.rb_4)
  303. destroy(this.cbx_1)
  304. destroy(this.rb_11)
  305. destroy(this.rb_12)
  306. destroy(this.em_01)
  307. destroy(this.em_02)
  308. destroy(this.st_01)
  309. destroy(this.gb_1)
  310. destroy(this.ddlb_size)
  311. destroy(this.st_02)
  312. destroy(this.cbx_2)
  313. destroy(this.em_03)
  314. destroy(this.cbx_3)
  315. end on
  316. event open;call super::open;f_wcenter(this)
  317. string ls_currentrecord,ls_orientation
  318. is_datasource=istr_rpt.datasource
  319. dw1=istr_rpt.userdw
  320. dw2=istr_rpt.userdw2
  321. is_setup=istr_rpt.uservar
  322. dft_printername = istr_rpt.printername
  323. is_pwidth=mid(is_setup,11,5)
  324. is_phigh=mid(is_setup,16,5)
  325. if is_pwidth='' then is_pwidth='0127'
  326. if is_phigh='' then is_phigh='0127'
  327. em_01.text=is_pwidth
  328. em_02.text=is_phigh
  329. ls_currentrecord=mid(is_setup,10,1)//打印当前记录
  330. ls_orientation=mid(is_setup,7,1)//打印方向
  331. if ls_currentrecord='' then ls_currentrecord='n'
  332. is_size=string(dw2.Object.DataWindow.Print.Paper.Size)
  333. //获取纸张大小列表
  334. wf_getpaperlist()
  335. //choose case is_size
  336. // case '9'
  337. // ddlb_1.text='A4复印纸 9'
  338. // case '8'
  339. // ddlb_1.text='A3复印纸 8'
  340. // case '0','256'
  341. // ddlb_1.text='自定义纸 0'
  342. // case '1'
  343. // ddlb_1.text='窄行打印纸 1'
  344. // case else
  345. // ddlb_1.text='宽行打印纸 39'
  346. //end choose
  347. if is_size<>'0' and is_size<>'256' then
  348. st_01.visible=false
  349. st_02.visible=false
  350. st_03.visible=false
  351. em_01.visible=false
  352. em_02.visible=false
  353. end if
  354. em_size.text = string(is_size)
  355. if ls_orientation='1' then
  356. rb_12.checked=true
  357. else
  358. rb_11.checked=true
  359. end if
  360. is_range=dw2.Object.DataWindow.Print.Page.Range
  361. if ls_currentrecord='y' then //打印当前记录
  362. rb_4.checked=true
  363. rb_5.checked=false
  364. em_1.enabled=false
  365. em_2.enabled=false
  366. else
  367. if is_range='' then
  368. em_1.enabled=false
  369. em_2.enabled=false
  370. else
  371. rb_5.checked=false
  372. rb_6.checked=true
  373. em_1.enabled=true
  374. em_2.enabled=true
  375. end if
  376. end if
  377. if mid(is_setup,9,1)='y' then//纸张套打
  378. cbx_1.checked=true
  379. else
  380. cbx_1.checked=false
  381. end if
  382. if mid(is_setup,21,1)='1' then//打完不走纸,暂时不起作用
  383. cbx_2.checked=true
  384. else
  385. cbx_2.checked=false
  386. end if
  387. if mid(is_setup,22,1)='1' then//每页固定行数
  388. cbx_3.checked=true
  389. em_03.enabled=true
  390. end if
  391. em_03.text=mid(is_setup,23,3)//每页固定行数
  392. if is_range='' then
  393. em_1.text='1'
  394. if dw2.rowcount()>0 then
  395. em_2.text=dw2.Describe("evaluate('pagecount()',1)")//打印总页数
  396. else
  397. em_2.text='1'
  398. end if
  399. else
  400. em_1.text=left(is_range,pos(is_range,'-') - 1)
  401. em_2.text=right(is_range,len(is_range) - pos(is_range,'-'))
  402. end if
  403. em_3.text=string(dw2.Object.DataWindow.zoom)
  404. //if not isvalid(dw1) then//报表设计窗口没打开
  405. // ddlb_1.enabled=false
  406. // em_3.enabled=false
  407. // cbx_1.enabled=false
  408. //end if
  409. if is_datasource<>'dw' then
  410. rb_4.enabled=false
  411. end if
  412. end event
  413. type em_size from editmask within w_rpt_setup
  414. integer x = 1317
  415. integer y = 204
  416. integer width = 210
  417. integer height = 84
  418. integer taborder = 50
  419. boolean bringtotop = true
  420. integer textsize = -9
  421. integer weight = 400
  422. fontpitch fontpitch = variable!
  423. string facename = "宋体"
  424. long backcolor = 16777215
  425. alignment alignment = right!
  426. borderstyle borderstyle = stylelowered!
  427. string mask = "####0"
  428. string displaydata = ""
  429. double increment = 1
  430. string minmax = "1~~"
  431. end type
  432. type st_4 from statictext within w_rpt_setup
  433. integer x = 1051
  434. integer y = 208
  435. integer width = 233
  436. integer height = 64
  437. integer textsize = -9
  438. integer weight = 400
  439. fontcharset fontcharset = gb2312charset!
  440. fontpitch fontpitch = variable!
  441. string facename = "宋体"
  442. long backcolor = 80269524
  443. string text = "纸张Size"
  444. boolean focusrectangle = false
  445. end type
  446. type st_3 from statictext within w_rpt_setup
  447. integer x = 1051
  448. integer y = 112
  449. integer width = 219
  450. integer height = 64
  451. integer textsize = -9
  452. integer weight = 400
  453. fontcharset fontcharset = gb2312charset!
  454. fontpitch fontpitch = variable!
  455. string facename = "宋体"
  456. long backcolor = 80269524
  457. string text = "纸张列表"
  458. boolean focusrectangle = false
  459. end type
  460. type st_papersize from statictext within w_rpt_setup
  461. integer x = 1829
  462. integer y = 544
  463. integer width = 402
  464. integer height = 68
  465. integer textsize = -9
  466. integer weight = 400
  467. fontcharset fontcharset = gb2312charset!
  468. fontpitch fontpitch = variable!
  469. string facename = "宋体"
  470. long backcolor = 80269524
  471. alignment alignment = right!
  472. boolean focusrectangle = false
  473. end type
  474. type st_paperlist from statictext within w_rpt_setup
  475. integer x = 1061
  476. integer y = 544
  477. integer width = 402
  478. integer height = 68
  479. integer textsize = -9
  480. integer weight = 400
  481. fontcharset fontcharset = gb2312charset!
  482. fontpitch fontpitch = variable!
  483. string facename = "宋体"
  484. long backcolor = 80269524
  485. alignment alignment = right!
  486. boolean focusrectangle = false
  487. end type
  488. type st_03 from statictext within w_rpt_setup
  489. integer x = 1893
  490. integer y = 212
  491. integer width = 73
  492. integer height = 64
  493. integer textsize = -9
  494. integer weight = 400
  495. fontcharset fontcharset = gb2312charset!
  496. fontpitch fontpitch = variable!
  497. string facename = "宋体"
  498. long backcolor = 80269524
  499. string text = "高"
  500. alignment alignment = right!
  501. boolean focusrectangle = false
  502. end type
  503. type cb_1 from commandbutton within w_rpt_setup
  504. integer x = 251
  505. integer y = 660
  506. integer width = 242
  507. integer height = 108
  508. integer taborder = 120
  509. boolean bringtotop = true
  510. integer textsize = -9
  511. integer weight = 400
  512. fontpitch fontpitch = variable!
  513. string facename = "宋体"
  514. string text = "确定"
  515. end type
  516. event clicked;is_size= em_size.text
  517. if rb_4.checked=true then//打印当前记录
  518. is_size=is_size+space(9 -len(is_size))+'y'
  519. is_range=''
  520. elseif rb_5.checked=true then//全部打印
  521. is_size=is_size+space(9 -len(is_size))+'n'
  522. is_range=''
  523. elseif rb_6.checked=true then//打印页数
  524. is_size=is_size+space(9 -len(is_size))+'n'
  525. is_range=em_1.text+'-'+em_2.text
  526. end if
  527. if cbx_1.checked=true then//纸张套打
  528. is_size=left(is_size,8)+'y'+mid(is_size,10)
  529. else
  530. is_size=left(is_size,8)+'n'+mid(is_size,10)
  531. end if
  532. if rb_12.checked=true then//纵向
  533. is_size=left(is_size,6)+'1'+mid(is_size,8)
  534. else
  535. is_size=left(is_size,6)+'2'+mid(is_size,8)//横向
  536. end if
  537. is_pwidth=string(long(em_01.text),'00000')
  538. is_size=is_size+is_pwidth//15
  539. is_phigh=string(long(em_02.text),'00000')
  540. is_size=is_size+is_phigh//20
  541. if cbx_2.checked=true then//打完不走纸,暂时不起作用
  542. is_size=is_size+'1'//21
  543. else
  544. is_size=is_size+'0'//21
  545. end if
  546. if cbx_3.checked=true then//每页固定行数标志
  547. is_size=is_size+'1'//22
  548. else
  549. is_size=is_size+'0'//22
  550. end if
  551. is_size=is_size+string(long(em_03.text),'000')//每页固定行数
  552. ii_percent=long(em_3.text)
  553. //w_rpt_preview.is_setup=is_size
  554. //w_rpt_preview.ii_percent=ii_percent
  555. is_temp=is_range+','+is_size+';'+string(ii_percent)
  556. closewithreturn(parent,is_temp)
  557. end event
  558. type cb_2 from commandbutton within w_rpt_setup
  559. integer x = 768
  560. integer y = 660
  561. integer width = 242
  562. integer height = 108
  563. integer taborder = 140
  564. boolean bringtotop = true
  565. integer textsize = -9
  566. integer weight = 400
  567. fontpitch fontpitch = variable!
  568. string facename = "宋体"
  569. string text = "取消"
  570. end type
  571. event clicked;close(parent)
  572. end event
  573. type gb_11 from groupbox within w_rpt_setup
  574. integer x = 1024
  575. integer y = 320
  576. integer width = 658
  577. integer height = 192
  578. integer taborder = 10
  579. integer textsize = -9
  580. integer weight = 400
  581. fontpitch fontpitch = variable!
  582. string facename = "宋体"
  583. long backcolor = 80269524
  584. string text = "打印方向"
  585. end type
  586. type gb_3 from groupbox within w_rpt_setup
  587. integer x = 681
  588. integer y = 52
  589. integer width = 329
  590. integer height = 200
  591. integer taborder = 30
  592. integer textsize = -9
  593. integer weight = 400
  594. fontpitch fontpitch = variable!
  595. string facename = "宋体"
  596. long backcolor = 80269524
  597. string text = "打印比例%"
  598. end type
  599. type gb_2 from groupbox within w_rpt_setup
  600. integer x = 18
  601. integer y = 52
  602. integer width = 626
  603. integer height = 400
  604. integer taborder = 100
  605. integer textsize = -9
  606. integer weight = 400
  607. fontpitch fontpitch = variable!
  608. string facename = "宋体"
  609. long backcolor = 80269524
  610. string text = "打印范围"
  611. end type
  612. type rb_5 from radiobutton within w_rpt_setup
  613. integer x = 64
  614. integer y = 180
  615. integer width = 288
  616. integer height = 76
  617. boolean bringtotop = true
  618. integer textsize = -9
  619. integer weight = 400
  620. fontpitch fontpitch = variable!
  621. string facename = "宋体"
  622. long backcolor = 80269524
  623. string text = "全部"
  624. boolean checked = true
  625. end type
  626. event clicked;em_1.enabled=false
  627. em_2.enabled=false
  628. end event
  629. type rb_6 from radiobutton within w_rpt_setup
  630. integer x = 64
  631. integer y = 256
  632. integer width = 242
  633. integer height = 76
  634. boolean bringtotop = true
  635. integer textsize = -9
  636. integer weight = 400
  637. fontpitch fontpitch = variable!
  638. string facename = "宋体"
  639. long backcolor = 80269524
  640. string text = "页数"
  641. end type
  642. event clicked;em_1.enabled=true
  643. em_2.enabled=true
  644. end event
  645. type st_1 from statictext within w_rpt_setup
  646. integer x = 69
  647. integer y = 344
  648. integer width = 55
  649. integer height = 64
  650. boolean bringtotop = true
  651. integer textsize = -9
  652. integer weight = 400
  653. fontpitch fontpitch = variable!
  654. string facename = "宋体"
  655. long backcolor = 80269524
  656. boolean enabled = false
  657. string text = "从"
  658. alignment alignment = right!
  659. boolean focusrectangle = false
  660. end type
  661. type st_2 from statictext within w_rpt_setup
  662. integer x = 334
  663. integer y = 344
  664. integer width = 64
  665. integer height = 64
  666. boolean bringtotop = true
  667. integer textsize = -9
  668. integer weight = 400
  669. fontpitch fontpitch = variable!
  670. string facename = "宋体"
  671. long backcolor = 80269524
  672. boolean enabled = false
  673. string text = "到"
  674. alignment alignment = right!
  675. boolean focusrectangle = false
  676. end type
  677. type em_1 from editmask within w_rpt_setup
  678. integer x = 128
  679. integer y = 332
  680. integer width = 210
  681. integer height = 84
  682. integer taborder = 40
  683. boolean bringtotop = true
  684. integer textsize = -9
  685. integer weight = 400
  686. fontpitch fontpitch = variable!
  687. string facename = "宋体"
  688. long backcolor = 16777215
  689. alignment alignment = right!
  690. borderstyle borderstyle = stylelowered!
  691. string mask = "####0"
  692. boolean spin = true
  693. string displaydata = ""
  694. double increment = 1
  695. string minmax = "1~~"
  696. end type
  697. type em_2 from editmask within w_rpt_setup
  698. integer x = 402
  699. integer y = 332
  700. integer width = 210
  701. integer height = 84
  702. integer taborder = 80
  703. boolean bringtotop = true
  704. integer textsize = -9
  705. integer weight = 400
  706. fontpitch fontpitch = variable!
  707. string facename = "宋体"
  708. long backcolor = 16777215
  709. alignment alignment = right!
  710. borderstyle borderstyle = stylelowered!
  711. string mask = "####0"
  712. boolean spin = true
  713. string displaydata = ""
  714. double increment = 1
  715. string minmax = "1~~"
  716. end type
  717. type em_3 from editmask within w_rpt_setup
  718. integer x = 727
  719. integer y = 124
  720. integer width = 238
  721. integer height = 84
  722. integer taborder = 110
  723. boolean bringtotop = true
  724. integer textsize = -9
  725. integer weight = 400
  726. fontpitch fontpitch = variable!
  727. string facename = "宋体"
  728. long backcolor = 16777215
  729. string text = "100"
  730. alignment alignment = right!
  731. borderstyle borderstyle = stylelowered!
  732. string mask = "###"
  733. boolean spin = true
  734. double increment = 1
  735. string minmax = "1~~999"
  736. end type
  737. type cb_20 from commandbutton within w_rpt_setup
  738. event clicked pbm_bnclicked
  739. integer x = 1285
  740. integer y = 660
  741. integer width = 274
  742. integer height = 108
  743. integer taborder = 130
  744. integer textsize = -9
  745. integer weight = 400
  746. fontpitch fontpitch = variable!
  747. string facename = "宋体"
  748. string text = "帮助(&H)"
  749. end type
  750. event clicked;ShowHelp("report.HLP", keyword!, "report_setup")
  751. end event
  752. type rb_4 from radiobutton within w_rpt_setup
  753. event clicked pbm_bnclicked
  754. integer x = 64
  755. integer y = 112
  756. integer width = 315
  757. integer height = 68
  758. boolean bringtotop = true
  759. integer textsize = -9
  760. integer weight = 400
  761. fontpitch fontpitch = variable!
  762. string facename = "宋体"
  763. long backcolor = 80269524
  764. string text = "当前记录"
  765. end type
  766. event clicked;em_1.enabled=false
  767. em_2.enabled=false
  768. end event
  769. type cbx_1 from checkbox within w_rpt_setup
  770. integer x = 677
  771. integer y = 288
  772. integer width = 302
  773. integer height = 76
  774. boolean bringtotop = true
  775. integer textsize = -9
  776. integer weight = 400
  777. fontpitch fontpitch = variable!
  778. string facename = "宋体"
  779. long backcolor = 80269524
  780. string text = "纸张套打"
  781. end type
  782. type rb_11 from radiobutton within w_rpt_setup
  783. integer x = 1088
  784. integer y = 404
  785. integer width = 197
  786. integer height = 76
  787. boolean bringtotop = true
  788. integer textsize = -9
  789. integer weight = 400
  790. fontpitch fontpitch = variable!
  791. string facename = "宋体"
  792. long backcolor = 80269524
  793. string text = "纵向"
  794. end type
  795. type rb_12 from radiobutton within w_rpt_setup
  796. integer x = 1417
  797. integer y = 404
  798. integer width = 197
  799. integer height = 76
  800. boolean bringtotop = true
  801. integer textsize = -9
  802. integer weight = 400
  803. fontpitch fontpitch = variable!
  804. string facename = "宋体"
  805. long backcolor = 80269524
  806. string text = "横向"
  807. end type
  808. type em_01 from editmask within w_rpt_setup
  809. integer x = 1632
  810. integer y = 200
  811. integer width = 251
  812. integer height = 84
  813. integer taborder = 50
  814. boolean bringtotop = true
  815. integer textsize = -9
  816. integer weight = 400
  817. fontpitch fontpitch = variable!
  818. string facename = "宋体"
  819. long backcolor = 16777215
  820. alignment alignment = right!
  821. borderstyle borderstyle = stylelowered!
  822. string mask = "####0"
  823. boolean spin = true
  824. double increment = 1
  825. string minmax = "127~~4191"
  826. end type
  827. type em_02 from editmask within w_rpt_setup
  828. integer x = 1966
  829. integer y = 204
  830. integer width = 251
  831. integer height = 84
  832. integer taborder = 60
  833. boolean bringtotop = true
  834. integer textsize = -9
  835. integer weight = 400
  836. fontpitch fontpitch = variable!
  837. string facename = "宋体"
  838. long backcolor = 16777215
  839. alignment alignment = right!
  840. borderstyle borderstyle = stylelowered!
  841. string mask = "####0"
  842. boolean spin = true
  843. double increment = 1
  844. string minmax = "127~~23119"
  845. end type
  846. type st_01 from statictext within w_rpt_setup
  847. integer x = 1536
  848. integer y = 212
  849. integer width = 73
  850. integer height = 64
  851. boolean bringtotop = true
  852. integer textsize = -9
  853. integer weight = 400
  854. fontpitch fontpitch = variable!
  855. string facename = "宋体"
  856. long backcolor = 80269524
  857. boolean enabled = false
  858. string text = "宽"
  859. alignment alignment = right!
  860. boolean focusrectangle = false
  861. end type
  862. type gb_1 from groupbox within w_rpt_setup
  863. integer x = 1024
  864. integer y = 32
  865. integer width = 1499
  866. integer height = 288
  867. integer taborder = 20
  868. integer textsize = -9
  869. integer weight = 400
  870. fontpitch fontpitch = variable!
  871. string facename = "宋体"
  872. long backcolor = 80269524
  873. string text = "纸张参数"
  874. end type
  875. type ddlb_size from dropdownlistbox within w_rpt_setup
  876. integer x = 1280
  877. integer y = 96
  878. integer width = 1207
  879. integer height = 352
  880. integer taborder = 90
  881. boolean bringtotop = true
  882. integer textsize = -9
  883. integer weight = 400
  884. fontcharset fontcharset = gb2312charset!
  885. fontpitch fontpitch = variable!
  886. string facename = "宋体"
  887. long textcolor = 33554432
  888. boolean sorted = false
  889. boolean vscrollbar = true
  890. borderstyle borderstyle = stylelowered!
  891. end type
  892. event selectionchanged;if this.text= '自定义纸' then
  893. st_01.visible=true
  894. st_02.visible=true
  895. st_03.visible=true
  896. em_01.visible=true
  897. em_02.visible=true
  898. else
  899. st_01.visible=false
  900. st_02.visible=false
  901. st_03.visible=false
  902. em_01.visible=false
  903. em_02.visible=false
  904. end if
  905. wf_getpapersize()
  906. end event
  907. type st_02 from statictext within w_rpt_setup
  908. integer x = 2217
  909. integer y = 212
  910. integer width = 288
  911. integer height = 76
  912. boolean bringtotop = true
  913. integer textsize = -9
  914. integer weight = 400
  915. fontcharset fontcharset = gb2312charset!
  916. fontpitch fontpitch = variable!
  917. string facename = "宋体"
  918. long textcolor = 33554432
  919. long backcolor = 67108864
  920. boolean enabled = false
  921. string text = "单位:0.1mm"
  922. alignment alignment = center!
  923. boolean focusrectangle = false
  924. end type
  925. type cbx_2 from checkbox within w_rpt_setup
  926. boolean visible = false
  927. integer x = 677
  928. integer y = 372
  929. integer width = 361
  930. integer height = 76
  931. boolean bringtotop = true
  932. integer textsize = -9
  933. integer weight = 400
  934. fontpitch fontpitch = variable!
  935. string facename = "宋体"
  936. long backcolor = 80269524
  937. string text = "打完不走纸"
  938. end type
  939. type em_03 from editmask within w_rpt_setup
  940. integer x = 462
  941. integer y = 464
  942. integer width = 192
  943. integer height = 84
  944. integer taborder = 70
  945. boolean bringtotop = true
  946. integer textsize = -9
  947. integer weight = 400
  948. fontcharset fontcharset = gb2312charset!
  949. fontpitch fontpitch = variable!
  950. string facename = "宋体"
  951. long backcolor = 16777215
  952. boolean enabled = false
  953. alignment alignment = right!
  954. borderstyle borderstyle = stylelowered!
  955. string mask = "###"
  956. boolean spin = true
  957. double increment = 1
  958. string minmax = "0~~999"
  959. end type
  960. type cbx_3 from checkbox within w_rpt_setup
  961. integer x = 41
  962. integer y = 468
  963. integer width = 411
  964. integer height = 76
  965. boolean bringtotop = true
  966. integer textsize = -9
  967. integer weight = 400
  968. fontpitch fontpitch = variable!
  969. string facename = "宋体"
  970. long backcolor = 80269524
  971. string text = "每页固定行数"
  972. end type
  973. event clicked;if checked then
  974. em_03.enabled=true
  975. else
  976. em_03.enabled=false
  977. end if
  978. end event