w_rpt_main.srw 153 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101
  1. $PBExportHeader$w_rpt_main.srw
  2. $PBExportComments$主设计器--窗口
  3. forward
  4. global type w_rpt_main from w_rpt_base
  5. end type
  6. type mdi_1 from mdiclient within w_rpt_main
  7. end type
  8. type cb_hidebackgroud from commandbutton within w_rpt_main
  9. end type
  10. type cb_setbackgroud from commandbutton within w_rpt_main
  11. end type
  12. type dw3 from datawindow within w_rpt_main
  13. end type
  14. type dwx from datawindow within w_rpt_main
  15. end type
  16. type dwy from datawindow within w_rpt_main
  17. end type
  18. type ddlb_1 from dropdownlistbox within w_rpt_main
  19. end type
  20. type ddlb_2 from dropdownlistbox within w_rpt_main
  21. end type
  22. type ln_1 from line within w_rpt_main
  23. end type
  24. type dwc1 from datawindow within w_rpt_main
  25. end type
  26. type st_1 from statictext within w_rpt_main
  27. end type
  28. type sle_1 from singlelineedit within w_rpt_main
  29. end type
  30. type dw1 from datawindow within w_rpt_main
  31. end type
  32. type dwc2 from uo_scolor within w_rpt_main
  33. end type
  34. type cbx_lock from checkbox within w_rpt_main
  35. end type
  36. end forward
  37. shared variables
  38. end variables
  39. global type w_rpt_main from w_rpt_base
  40. integer y = 4
  41. integer width = 3968
  42. integer height = 2380
  43. string title = "数据窗口编辑器"
  44. string menuname = "m_rpt_main"
  45. windowtype windowtype = mdi!
  46. long backcolor = 80269524
  47. event ue_toolbar ( string mybarname, menu mymenu )
  48. event ue_preview ( )
  49. event ue_sel_no ( )
  50. event ue_copy ( )
  51. event ue_allposition ( string as_direct )
  52. event ue_save ( )
  53. event ue_auto ( )
  54. event ue_sel_yes ( string select_type )
  55. event ue_datasource ( )
  56. event ue_deletegroup ( )
  57. event ue_delobj ( )
  58. event ue_insertgroup ( )
  59. event ue_properties ( string tt )
  60. event ue_outside ( )
  61. event ue_cc ( integer ai_cc )
  62. event ue_edit_report ( )
  63. event ue_upload ( )
  64. event ue_saveupload ( )
  65. event ue_beforesave ( )
  66. event ue_aftersave ( )
  67. mdi_1 mdi_1
  68. cb_hidebackgroud cb_hidebackgroud
  69. cb_setbackgroud cb_setbackgroud
  70. dw3 dw3
  71. dwx dwx
  72. dwy dwy
  73. ddlb_1 ddlb_1
  74. ddlb_2 ddlb_2
  75. ln_1 ln_1
  76. dwc1 dwc1
  77. st_1 st_1
  78. sle_1 sle_1
  79. dw1 dw1
  80. dwc2 dwc2
  81. cbx_lock cbx_lock
  82. end type
  83. global w_rpt_main w_rpt_main
  84. type prototypes
  85. Function string f_cdw(string s1,string s2,string s3,string s4,string s5,string s6,string s7,string s8,string s9,string s10) Library "cdw.dll" alias for "f_cdw;Ansi"
  86. Function boolean SetCurrentDirectory(ref string lpPathName) Library "KERNEL32.DLL" Alias for "SetCurrentDirectoryA;Ansi"
  87. FUNCTION ulong GetCurrentDirectoryA(ulong BufferLen, ref string currentdir) LIBRARY "Kernel32.dll" alias for "GetCurrentDirectoryA;Ansi"
  88. end prototypes
  89. type variables
  90. datawindow id_userdw//前台报表设计时共享的用户dw
  91. string is_toolbar//当前按下的工具条名称
  92. string is_point="UP"//鼠标的状态
  93. string is_dw//创建动态数据窗口的语法
  94. string is_errors//出错信息字符串
  95. string is_auto//自动auto或手动mane+自动创建dw字体等
  96. long is_rid//报表编号
  97. string is_rname//报表中文名称
  98. string is_click_object//鼠标点击的对象名
  99. int ii_x//鼠标按下时的X值
  100. int ii_y//鼠标按下时的Y值
  101. int ii_x_max=4544//2272//x最大值
  102. int ii_y_max=3408//2272//y最大值
  103. int ii_x_scroll=0//鼠标在dw1向左右卷动的值
  104. int ii_y_scroll=0//鼠标在dw1向上下卷动的值
  105. int ii_group//当前分组数
  106. int ii_bbgs=1//自动设计时所选择的报表格式,1=表格式(标准宽度),2=表格式(压缩宽度),3=自由式
  107. string is_oexp//表达式的中文名
  108. string is_o2exp//表达式的英文名
  109. int ii_x_old//对象移动前的x值
  110. int ii_y_old//对象移动前的y值
  111. int iic//所选对象的总数
  112. int ii_topformove//带区上移时实际移动的距离
  113. string iso_old//前一对象的名称
  114. int ii_outside//移出边界方向
  115. datastore ids//存放dw语法
  116. string is_type//对象类型
  117. string is_band='detail'//带区
  118. string is_modify
  119. string is_scolor//颜色设置状态
  120. string is_sparse//压缩列
  121. datastore idsx//存放属性中英文名称
  122. robj io[],id[2]//存放所有对象属性的数组
  123. int iis//对象总数
  124. string is0[]//对象的属性英文名
  125. string ist//='01line02text03column04compute05graph06report07bitmap08tableblob09rectangle10button11gb12oval13rr'
  126. int ii[]//对象的属性数
  127. int iio//当前对象行
  128. string iso//当前所选的对象名称
  129. int ii_save//存盘标识
  130. decimal ln_bl=2.65295//单位换算比例
  131. string is_updatetable,is_updatewhere='1',is_updatekeyinplace='no',is_update
  132. datawindow idwm
  133. int ii_rowm
  134. int ii_xc//dwc2记录自定义颜色位置用
  135. string is_cm//dwc2记录自定义颜色对象用
  136. string is_path=Space(256)//保存当前路径
  137. boolean ib_resize_statbar = false
  138. boolean ib_save_flag
  139. boolean import_flag
  140. string ls_pblpath
  141. string ls_Tag
  142. m_rpt_main lm_rpt_main
  143. string ls_comments
  144. boolean ifreport = false
  145. ///////////////////////////////////////////////////////////////////
  146. string ibackgroudname = 'taoda_background_bmp'
  147. string ifilename = ''
  148. s_background_rslt s_tran
  149. end variables
  150. forward prototypes
  151. public subroutine wf_setcolor ()
  152. public function integer wf_topformove ()
  153. public function string wf_arguments (string s_syntax)
  154. public subroutine wf_read (string f_label)
  155. public subroutine wf_resetoid ()
  156. public subroutine wf_allset (string f_set, string f_new)
  157. public function string wf_idscreate ()
  158. public subroutine wf_unit ()
  159. public function integer wf_afind ()
  160. public function string wf_object (integer j, integer k)
  161. public subroutine wf_adelete (integer j)
  162. public subroutine wf_asort (string fs)
  163. public subroutine wf_band4 (integer h1, integer h2, integer h3, integer h4, integer f_label)
  164. public subroutine wf_insertgroup (integer i_h, integer i_b, string s_oexp, string s_o2exp, string s_newpage, string s_resetpagecount, integer f_label)
  165. public subroutine wf_format (string s_type)
  166. public subroutine wf_title (integer i_x, integer i_y, string s_fname, integer i_fsize)
  167. public subroutine wf_page (integer i_x, integer i_y, string s_fname, integer i_fsize)
  168. public subroutine wf_libexport ()
  169. public subroutine wf_libimport ()
  170. public function string wf_ssx (string s1, string s2, string s3, string s4)
  171. public function integer wf_crosstabc ()
  172. public subroutine wf_dwinit ()
  173. public subroutine wf_obj0 ()
  174. public function string wf_rowindetail (string s1, string s2)
  175. public subroutine wf_aftermove (integer y1_add, integer ff)
  176. public function string wf_mysx (string fsx)
  177. public subroutine wf_wdata ()
  178. public subroutine wf_alldel ()
  179. public function long wf_occ (integer icc)
  180. public subroutine wf_dwimport ()
  181. public function integer wf_upload (string arg_dwsyn, ref string arg_msg)
  182. public function integer wf_write ()
  183. public function string wf_nest_arguments (string s_syntax)
  184. public function double wf_mm_to_unitsx (string ls_units, double ld_mm)
  185. public function double wf_mm_to_unitsy (string ls_units, double ld_mm)
  186. public function double wf_unitsx_to_mm (string ls_units, double ld_unit)
  187. public function double wf_unitsy_to_mm (string ls_units, double ld_unit)
  188. end prototypes
  189. event ue_toolbar;//按下工具条时处理代码
  190. if is_toolbar=mybarname then//当前按钮已经按下,则弹起
  191. is_toolbar=''
  192. else//当前按钮没有按下
  193. event ue_sel_no()//清除选择
  194. wf_setcolor()//设置颜色
  195. is_toolbar=mybarname//设置当前按钮
  196. end if
  197. if is_toolbar='' then
  198. mymenu.Checked=false//弹起按钮
  199. else
  200. mymenu.Checked=true//按下按钮
  201. end if
  202. if NOT IsValid(m_rpt_main) then
  203. m_rpt_main = lm_rpt_main
  204. end if
  205. if mybarname='taborder' then
  206. if is_toolbar>'' then
  207. for i=1 to iis
  208. if io[i].otype='column' then
  209. s[1]="create text(band=detail name="+io[i].oname+"_zkl0 text='"+string(long(f_rsx(io[i].others,'tabsequence')))+"' x='"+io[i].ox1+"' y='"+string(long(io[i].oy1) -13)+"' width='24' height='12' font.face='宋体' font.height='12' alignment='0' border='0' color='255' background.color='536870912' background.mode='2')"
  210. dw1.modify(s[1])
  211. end if
  212. next
  213. m_rpt_main.m_1.enabled=false
  214. m_rpt_main.m_2.enabled=false
  215. m_rpt_main.m_dq.enabled=false
  216. m_rpt_main.m_bk.enabled=false
  217. m_rpt_main.m_xs.enabled=false
  218. m_rpt_main.m_4.enabled=false
  219. m_rpt_main.m_3.m_sep1.enabled=false
  220. m_rpt_main.m_3.m_dxfz.enabled=false
  221. m_rpt_main.m_3.m_sql.enabled=false
  222. else
  223. for i=1 to iis
  224. if io[i].otype='column' then
  225. io[i].oselect=dw1.describe(io[i].oname+'_zkl0.text')
  226. end if
  227. next
  228. wf_asort('select')
  229. ii_temp=0
  230. for i=1 to iis
  231. if io[i].otype='column' then
  232. if long(io[i].oselect)>0 then
  233. ii_temp++
  234. f_wsx(io[i].others,'tabsequence',string(ii_temp*10))
  235. else
  236. f_wsx(io[i].others,'tabsequence','')
  237. end if
  238. end if
  239. next
  240. dw1.modify('destroy zkl0')
  241. for i=1 to iis
  242. if io[i].otype='column' then
  243. dw1.modify('destroy '+io[i].oname+'_zkl0')
  244. io[i].oselect=''
  245. end if
  246. next
  247. m_rpt_main.m_1.enabled=true
  248. m_rpt_main.m_2.enabled=true
  249. m_rpt_main.m_dq.enabled=true
  250. m_rpt_main.m_bk.enabled=true
  251. m_rpt_main.m_xs.enabled=true
  252. m_rpt_main.m_4.enabled=true
  253. m_rpt_main.m_3.m_sep1.enabled=true
  254. m_rpt_main.m_3.m_dxfz.enabled=true
  255. m_rpt_main.m_3.m_sql.enabled=true
  256. end if
  257. end if
  258. end event
  259. event ue_preview();//报表预览代码
  260. IF NOT ib_save_flag AND NOT import_flag THEN
  261. MessageBox('提示','请先存盘')
  262. RETURN
  263. END IF
  264. s_rpt_print_msg s_print
  265. wf_resetoid()
  266. if wf_write() = 0 then return
  267. IF import_flag THEN
  268. s_print.isdw = is_dw
  269. else
  270. s_print.isdw = ''
  271. s_print.rpid = istr_rpt.rid
  272. s_print.tag_text = istr_rpt.billname
  273. s_print.rpname = is_rname
  274. END IF
  275. s_print.retr_pram_falg = istr_rpt.retr_pram_falg
  276. s_print.retr_flag = istr_rpt.retr_flag
  277. OpenWithParm(w_rpt_preview,s_print)
  278. end event
  279. event ue_sel_no;//释放所有选择对象
  280. for i=1 to iis
  281. io[i].oselect=''
  282. next
  283. iic=0
  284. end event
  285. event ue_copy;//对象拷贝事件
  286. long li_line,li_text,li_edit,li_rectangle,li_bitmap,li_blob,li_report,li_graph,li_button,li_gb,li_oval,li_rr,li_rows,j
  287. string lso
  288. for i=1 to iis
  289. lso=io[i].oname
  290. choose case io[i].otype
  291. case 'line'
  292. li_line=max(li_line,long(mid(lso,7)))
  293. case 'text'
  294. li_text=max(li_text,long(mid(lso,6)))
  295. case 'column','compute'
  296. li_edit=max(li_edit,long(mid(lso,6)))
  297. case 'rectangle'
  298. li_rectangle=max(li_rectangle,long(mid(lso,11)))
  299. case 'bitmap'
  300. li_bitmap=max(li_bitmap,long(mid(lso,8)))
  301. case 'tableblob'
  302. li_blob=max(li_blob,long(mid(lso,11)))
  303. case 'report'
  304. li_report=max(li_report,long(mid(lso,8)))
  305. case 'graph'
  306. li_graph=max(li_graph,long(mid(lso,7)))
  307. case 'button'
  308. li_button=max(li_button,long(mid(lso,8)))
  309. case 'groupbox'
  310. li_gb=max(li_gb,long(mid(lso,10)))
  311. case 'ellipse'
  312. li_oval=max(li_oval,long(mid(lso,9)))
  313. case 'roundrectangle'
  314. li_rr=max(li_rr,long(mid(lso,16)))
  315. end choose
  316. next
  317. dw1.setredraw(false)
  318. li_rows=iis
  319. for j=1 to li_rows
  320. if io[j].oselect<'1' or io[j].otype='band' then continue
  321. iis++
  322. i=iis
  323. io[i]=io[j]
  324. io[j].oselect=''
  325. lso=io[j].oname
  326. io[i].occ=wf_occ(1)+1//对象层次
  327. io[i].oy1=string(long(io[i].oy1)+18)
  328. io[i].oy2=string(long(io[i].oy2)+18)
  329. choose case io[i].otype
  330. case 'line'
  331. li_line++
  332. lso=left(lso,6)+string(li_line)
  333. case 'text'
  334. li_text++
  335. lso='text_'+string(li_text)
  336. case 'column','compute'
  337. li_edit++
  338. lso='edit_'+string(li_edit)
  339. case 'rectangle'
  340. li_rectangle++
  341. lso='rectangle_'+string(li_rectangle)
  342. case 'bitmap'
  343. li_bitmap++
  344. lso='bitmap_'+string(li_bitmap)
  345. case 'tableblob'
  346. li_blob++
  347. lso='tableblob_'+string(li_blob)
  348. case 'report'
  349. li_report++
  350. lso='report_'+string(li_report)
  351. case 'graph'
  352. li_graph++
  353. lso='graph_'+string(li_graph)
  354. case 'button'
  355. li_button++
  356. lso='button_'+string(li_button)
  357. case 'groupbox'
  358. li_gb++
  359. lso='groupbox_'+string(li_gb)
  360. case 'ellipse'
  361. li_oval++
  362. lso='ellipse_'+string(li_oval)
  363. case 'roundrectangle'
  364. li_rr++
  365. lso='roundrectangle_'+string(li_rr)
  366. end choose
  367. io[i].oname=lso
  368. wf_object(i,0)
  369. next
  370. wf_setcolor()
  371. dw1.setredraw(true)
  372. return
  373. end event
  374. event ue_allposition;////所选对象上下左右对齐,或者置相同宽度相同高度,参数:as_direct
  375. int li_left,li_right,li_top,li_buttom,li_width,li_height,li_space
  376. if iic<=1 then return
  377. if left(as_direct,5)='space' then//等间距
  378. if iic<3 then return
  379. if as_direct='space-x' then//以下12行可以不要,因为有优点也有缺点
  380. wf_asort('x1')
  381. else//'space-y'
  382. wf_asort('y1')
  383. end if
  384. ii_temp=2
  385. for i=1 to iis
  386. if long(io[i].oselect)>2 then
  387. ii_temp++
  388. io[i].oselect=string(ii_temp)
  389. end if
  390. next//以上12行可以不要,因为有优点也有缺点
  391. wf_asort('select')
  392. end if
  393. for i=1 to iis
  394. if io[i].oselect='1' then//寻找click选中的第一个对象
  395. exit
  396. end if
  397. next
  398. if i>iis then i=1//如果没找到,就选第一条记录
  399. li_left=min(long(io[i].ox1),long(io[i].ox2))
  400. li_right=max(long(io[i].ox1),long(io[i].ox2))
  401. li_top=min(long(io[i].oy1),long(io[i].oy2))
  402. li_buttom=max(long(io[i].oy1),long(io[i].oy2))
  403. li_width=li_right - li_left
  404. li_height=li_buttom - li_top
  405. if pos(as_direct,'space')=1 then
  406. for i=1 to iis
  407. if io[i].oselect='2' then//寻找click选中的第二个对象
  408. exit
  409. end if
  410. next
  411. if i>iis then i=2//如果没找到,就选第二条记录
  412. if as_direct='space-x' then
  413. li_space=long(io[i].ox1) -li_right
  414. else//'space-y'
  415. li_space=long(io[i].oy1) -li_buttom
  416. end if
  417. end if
  418. dw1.setredraw(false)
  419. for i=1 to iis//循环处理所有要对齐的对象
  420. if io[i].oselect<'1' or io[i].otype='band' then continue
  421. choose case as_direct
  422. case 'left'//左对齐
  423. ii_temp=min(long(io[i].ox1),long(io[i].ox2))
  424. io[i].ox1=string(long(io[i].ox1)+li_left - ii_temp)
  425. io[i].ox2=string(long(io[i].ox2)+li_left - ii_temp)
  426. case 'right'//右对齐
  427. ii_temp=max(long(io[i].ox1),long(io[i].ox2))
  428. io[i].ox1=string(long(io[i].ox1)+li_right - ii_temp)
  429. io[i].ox2=string(long(io[i].ox2)+li_right - ii_temp)
  430. case 'up'//上对齐
  431. ii_temp=min(long(io[i].oy1),long(io[i].oy2))
  432. io[i].oy1=string(long(io[i].oy1)+li_top - ii_temp)
  433. io[i].oy2=string(long(io[i].oy2)+li_top - ii_temp)
  434. case 'down'//下对齐
  435. ii_temp=max(long(io[i].oy1),long(io[i].oy2))
  436. io[i].oy1=string(long(io[i].oy1)+li_buttom - ii_temp)
  437. io[i].oy2=string(long(io[i].oy2)+li_buttom - ii_temp)
  438. case 'width'//等宽
  439. if li_width>0 then
  440. if pos(io[i].oname,'line2')<>1 then
  441. ii_temp=min(long(io[i].ox1),long(io[i].ox2))
  442. io[i].ox1=string(ii_temp)
  443. io[i].ox2=string(ii_temp+li_width)
  444. end if
  445. end if
  446. case 'height'//等高
  447. if li_height>0 then
  448. if pos(io[i].oname,'line1')<>1 then
  449. ii_temp=min(long(io[i].oy1),long(io[i].oy2))
  450. io[i].oy1=string(ii_temp)
  451. io[i].oy2=string(ii_temp+li_height)
  452. end if
  453. end if
  454. case 'space-x','space-y'//等间距
  455. if long(io[i].ox2)<long(io[i].ox1) then
  456. is_temp=io[i].ox2
  457. io[i].ox2=io[i].ox1
  458. io[i].ox1=is_temp
  459. end if
  460. if long(io[i].oy2)<long(io[i].oy1) then
  461. is_temp=io[i].oy2
  462. io[i].oy2=io[i].oy1
  463. io[i].oy1=is_temp
  464. end if
  465. li_width=long(io[i].ox2) -long(io[i].ox1)
  466. li_height=long(io[i].oy2) -long(io[i].oy1)
  467. if as_direct='space-x' then//横向等间距
  468. if io[i].oselect>'1' then
  469. io[i].ox1=string(li_right+li_space)
  470. io[i].ox2=string(long(io[i].ox1)+li_width)
  471. end if
  472. li_right=long(io[i].ox2)
  473. else//纵向等间距
  474. if io[i].oselect>'1' then
  475. io[i].oy1=string(li_buttom+li_space)
  476. io[i].oy2=string(long(io[i].oy1)+li_height)
  477. end if
  478. li_buttom=long(io[i].oy2)
  479. end if
  480. end choose
  481. wf_object(i,1)
  482. next
  483. dw1.setredraw(true)
  484. return
  485. end event
  486. event ue_save;triggerevent('ue_beforesave')
  487. //语法保存
  488. wf_resetoid()
  489. if wf_write() = 0 then return
  490. Blob lblob
  491. lblob = Blob(is_dw,EncodingANSI!)
  492. IF NOT import_flag THEN
  493. //PB6.5(或PB7.0)+MSSQL2000下需要加上以下两行代码才不会出错,但PB8.0则可以不加
  494. UPDATE u_report_list Set Rpsyntax = '' Where rpid = :is_rid USING it_report;
  495. COMMIT USING it_report;
  496. UPDATE u_report_list
  497. SET flag = 1
  498. Where rpid = :is_rid USING it_report;
  499. UPDATEBLOB u_report_list
  500. Set Rpsyntax = :lblob
  501. Where rpid = :is_rid USING it_report;
  502. //if it_report.sqlnrows>0 then//PB8.0可以开放以下代码
  503. IF it_report.SQLCode = 0 THEN
  504. COMMIT USING it_report;
  505. ii_save = 0
  506. MessageBox('提示','保存成功!')
  507. ib_save_flag = TRUE
  508. ELSE
  509. ROLLBACK USING it_report;
  510. MessageBox('error!','保存失败!'+it_report.SQLErrText)
  511. END IF
  512. ELSE
  513. ///直接写入当前PBL
  514. String ls_error
  515. IF is_rname > '' THEN
  516. Long rslt
  517. IF ls_comments <> '' THEN
  518. rslt = LibraryImport(ls_pblpath,is_rname,ImportDataWindow!,is_dw,ls_error,ls_comments)
  519. ELSE
  520. rslt = LibraryImport(ls_pblpath,is_rname,ImportDataWindow!,is_dw,ls_error)
  521. END IF
  522. IF rslt = 1 THEN
  523. IF IsValid(w_publ_preview) THEN
  524. Long j
  525. FOR j = 1 TO w_publ_preview.it_max
  526. IF w_publ_preview.ls_dw_arr[j] = is_rname THEN
  527. w_publ_preview.wf_dowithm(22)
  528. EXIT
  529. END IF
  530. NEXT
  531. END IF
  532. MessageBox('提示','保存成功!')
  533. ELSE
  534. MessageBox('提示','保存失败!')
  535. END IF
  536. ELSE
  537. MessageBox('提示','保存失败!')
  538. END IF
  539. END IF
  540. triggerevent('ue_aftersave')
  541. RETURN
  542. end event
  543. event ue_auto();//自动设计时创建对象事件
  544. //clen1=字段汉字象素,clen2=字段长度象素
  545. //dw1=显示对象,dw2=对象内部数据,dw3=dw_rpt_column
  546. if is_datasource='dw' then
  547. datastore lds
  548. lds=create datastore
  549. lds.dataobject=dw3.dataobject
  550. dw3.rowscopy(1,dw3.rowcount(),Primary!,lds,1,Primary!)
  551. end if
  552. if import_flag then
  553. goto myband4
  554. end if
  555. istr_rpt.auto='auto'
  556. openwithparm(w_rpt_sql,istr_rpt,this)
  557. if not isvalid(message.powerobjectparm) then goto myband4
  558. istr_rpt=message.powerobjectparm
  559. openwithparm(w_rpt_message,'正在读取数据,请等候......')
  560. wf_alldel()
  561. int j,li_max1,li_max2,li_xx,li_nups,k
  562. int li_ls,li_hs,li_cls,li_chs,li_len1,li_len2,li_len3
  563. int li_height[4],li_rows,li_tfsize,li_bfsize
  564. string ls_tfname,ls_bfname
  565. ii_bbgs=long(istr_rpt.tt)
  566. ls_tfname=istr_rpt.t1//标题字体
  567. li_tfsize=long(istr_rpt.t2)//标题字号
  568. ls_bfname=istr_rpt.t3//内容字体
  569. li_bfsize =long(istr_rpt.t4)//内容字号
  570. li_rows=dw3.rowcount()//所选col
  571. if ii_bbgs<=5 then
  572. id[1].ox1='0'//processing数据窗口类型
  573. else
  574. id[1].ox1=string(ii_bbgs -5)
  575. end if
  576. choose case ii_bbgs
  577. case 10//report
  578. wf_band4(600,0,0,0,0)
  579. wf_obj0()
  580. is_toolbar='report'
  581. dw1.event clicked(10,10,0,dw1.object.datawindow)
  582. dw1.event doubleclicked(0,0,0,dw1.object.report_1)
  583. goto myband4
  584. case 8//graph
  585. wf_band4(600,0,0,0,0)
  586. wf_obj0()
  587. is_toolbar='graph'
  588. dw1.event clicked(4,4,0,dw1.object.datawindow)
  589. if iio>0 then
  590. io[iio].ox2='900'
  591. io[iio].oy2='590'
  592. end if
  593. io[iio].otext=is_rname
  594. wf_object(iio,1)
  595. dw1.event doubleclicked(0,0,0,dw1.object.graph_1)
  596. goto myband4
  597. case 9//crosstab
  598. istr_rpt.tt='crosstab'
  599. dw1.event doubleclicked(0,0,0,dw1.object.datawindow)
  600. istr_rpt.tt=''
  601. goto myband4
  602. case 1,4,6,5//1=表格式(标准宽度)
  603. ii_x=0
  604. if ii_bbgs=1 then
  605. li_xx=5
  606. else
  607. li_xx=2
  608. end if
  609. if ii_bbgs=5 then
  610. li_nups=long(istr_rpt.t5)
  611. if li_nups<1 then li_nups=1
  612. id[1].ofweight=string(li_nups)
  613. else
  614. li_nups=1
  615. end if
  616. for k=1 to li_nups
  617. ii_x=ii_x+li_xx
  618. for j=1 to li_rows+1
  619. if j<=li_rows then
  620. w_rpt_message.event ue_percent(i*100/li_rows)
  621. iis++
  622. i=iis
  623. is_oexp=dw3.getitemstring(j,'ctag')
  624. is_o2exp=dw3.getitemstring(j,'cname')
  625. li_len1=dw3.getitemnumber(j,'clen1')
  626. li_len2=dw3.getitemnumber(j,'clen2')
  627. io[i].otype='text'//字段标题
  628. if ii_bbgs=5 then
  629. io[i].oname=is_o2exp+'_'+string(k)+'_t'
  630. else
  631. io[i].oname=is_o2exp+'_t'
  632. end if
  633. io[i].otext=is_oexp
  634. io[i].oborder='0'
  635. io[i].ocolor='0'
  636. io[i].obcolor='536870912'
  637. io[i].others=io[i].others+'{background.mode=1}'//背景透明
  638. io[i].ox1=string(ii_x)
  639. io[i].oy1=string(50+li_bfsize - li_bfsize - 5)
  640. io[i].ox2=string(long(io[i].ox1)+max(li_len1,li_len2))
  641. io[i].oy2=string(long(io[i].oy1)+li_bfsize)
  642. io[i].ofname=ls_bfname
  643. io[i].ofsize=string(li_bfsize)
  644. io[i].oalignment='2'
  645. iis++
  646. i=iis
  647. io[i].otype='column'//字段
  648. io[i].others=io[i].others+'{id='+string(j)+'}'+'{tabsequence='+string(j*10)+'}'
  649. if ii_bbgs=5 then
  650. io[i].oname=is_o2exp+'_'+string(k)
  651. f_wsx(io[i].others,'row_in_detail',string(k))
  652. else
  653. io[i].oname=is_o2exp
  654. end if
  655. io[i].otext=is_oexp
  656. io[i].oborder='0'
  657. io[i].ocolor='0'
  658. io[i].obcolor='16777215'
  659. io[i].oexpression='edit'
  660. io[i].ox1=string(ii_x)
  661. io[i].oy1=string(50+li_bfsize+18)
  662. io[i].ox2=string(long(io[i].ox1)+max(li_len1,li_len2))
  663. io[i].oy2=string(long(io[i].oy1)+li_bfsize)
  664. io[i].ofname=ls_bfname
  665. io[i].ofsize=string(li_bfsize)
  666. wf_format(dw3.getitemstring(j,'ctype'))
  667. end if
  668. if ii_bbgs=1 then
  669. iis++
  670. i=iis
  671. io[i].otype='line'
  672. io[i].oname='line2_'+string(i*2 - 1) // li_rows+1条竖线
  673. io[i].ocolor='0'
  674. io[i].ox1=string(ii_x - 3)
  675. io[i].oy1=string(41)
  676. io[i].ox2=string(ii_x - 3)
  677. io[i].oy2=string(50+li_bfsize - 2)
  678. iis++
  679. i=iis
  680. io[i].otype='line'
  681. io[i].oname='line2_'+string(i*2)
  682. io[i].ocolor='0'
  683. io[i].ox1=string(ii_x - 3)
  684. io[i].oy1=string(50+li_bfsize+13)
  685. io[i].ox2=string(ii_x - 3)
  686. io[i].oy2=string(50+li_bfsize*2+14+8)
  687. end if
  688. if j<=li_rows then
  689. ii_x=ii_x+max(li_len1,li_len2)+li_xx
  690. if ii_x>ii_x_max then
  691. li_rows=j
  692. end if
  693. end if
  694. next
  695. next
  696. if ii_bbgs=1 then
  697. for j=1 to 3 // 三条横线
  698. iis++
  699. i=iis
  700. io[i].otype='line'
  701. io[i].oname='line1_'+string(i*2 - 2+j)
  702. io[i].ocolor='0'
  703. io[i].ox1=string(2)
  704. io[i].ox2=string(ii_x - 2)
  705. choose case j
  706. case 1
  707. io[i].oy1=string(41)
  708. io[i].oy2=string(41)
  709. case 2
  710. io[i].oy1=string(50+li_bfsize - 2)
  711. io[i].oy2=string(50+li_bfsize - 2)
  712. case 3
  713. io[i].oy1=string(50+li_bfsize*2+14+8)
  714. io[i].oy2=string(50+li_bfsize*2+14+8)
  715. end choose
  716. next
  717. end if
  718. wf_title(max((ii_x+4 - len(is_rname)*li_tfsize/2)/2,0),10,ls_tfname,li_tfsize)
  719. wf_page(min(max((ii_x+4 - 38*li_bfsize/2)/2,0),1000),50+li_bfsize*2+14+10+24+14,ls_bfname,li_bfsize)
  720. wf_band4(50+li_bfsize,li_bfsize+10,0,50,0)
  721. case 2 //表格式(压缩宽度)
  722. ii_x=5
  723. for j=1 to li_rows+1
  724. if j<=li_rows then
  725. w_rpt_message.event ue_percent(i*100/li_rows)
  726. iis++
  727. i=iis
  728. is_oexp=dw3.getitemstring(j,'ctag')
  729. is_o2exp=dw3.getitemstring(j,'cname')
  730. li_len1=dw3.getitemnumber(j,'clen1')
  731. li_len2=dw3.getitemnumber(j,'clen2')
  732. if li_len2 < li_bfsize then li_len2=li_bfsize
  733. io[i].otype='column'//字段
  734. io[i].others=io[i].others+'{id='+string(j)+'}'+'{tabsequence='+string(j*10)+'}'
  735. io[i].oname=is_o2exp//'edit_'+string(i)
  736. io[i].otext=is_oexp
  737. io[i].oborder='0'
  738. io[i].ocolor='0'
  739. io[i].obcolor='16777215'
  740. io[i].oexpression='edit'
  741. io[i].ox1=string(ii_x)
  742. io[i].oy1=string(50+li_bfsize*3+18)
  743. io[i].ox2=string(long(io[i].ox1)+li_len2)
  744. io[i].oy2=string(long(io[i].oy1)+li_bfsize)
  745. io[i].ofname=ls_bfname
  746. io[i].ofsize=string(li_bfsize)
  747. wf_format(dw3.getitemstring(j,'ctype'))
  748. iis++
  749. i=iis
  750. io[i].otype='text'//字段标题
  751. io[i].oname=is_o2exp+'_t'//'text_'+string(i)
  752. io[i].otext=is_oexp
  753. li_len3=int(li_len2*2/li_bfsize)
  754. if int(li_len3/2)<>li_len3/2 then li_len3=li_len3 - 1
  755. if li_len3=0 then li_len3=2
  756. if li_len1<=li_len2 then
  757. is_oexp=char(13)+is_oexp
  758. else
  759. if li_len1<=2*li_len2 then
  760. is_oexp=left(is_oexp,li_len3)+char(13)+char(13)+mid(is_oexp,li_len3+1)
  761. end if
  762. end if
  763. io[i].oborder='0'
  764. io[i].ocolor='0'
  765. io[i].obcolor='536870912'
  766. io[i].others=io[i].others+'{background.mode=1}'//背景透明
  767. io[i].ox1=string(ii_x)
  768. io[i].oy1=string(50+li_bfsize*3 - li_bfsize*3 - 5)
  769. io[i].ox2=string(long(io[i].ox1)+li_len2)
  770. io[i].oy2=string(long(io[i].oy1)+li_bfsize*3)
  771. io[i].ofname=ls_bfname
  772. io[i].ofsize=string(li_bfsize)
  773. io[i].oalignment='2'
  774. else
  775. wf_title(max((ii_x+4 - len(is_rname)*li_tfsize/2)/2,0),10,ls_tfname,li_tfsize)
  776. wf_page(min(max((ii_x+4 - 38*li_bfsize/2)/2,0),1000),50+li_bfsize*3+14+li_bfsize+10+24+14,ls_bfname,li_bfsize)
  777. end if
  778. iis++
  779. i=iis
  780. io[i].otype='line'
  781. io[i].oname='line2_'+string(i*2 - 1) // li_rows+1条竖线
  782. io[i].ocolor='0'
  783. io[i].ox1=string(ii_x - 3)
  784. io[i].oy1=string(50+li_bfsize*3 - li_bfsize*3 - 5 - 4)
  785. io[i].ox2=string(ii_x - 3)
  786. io[i].oy2=string(50+li_bfsize*3 - 2)
  787. iis++
  788. i=iis
  789. io[i].otype='line'
  790. io[i].oname='line2_'+string(i*2)
  791. io[i].ocolor='0'
  792. io[i].ox1=string(ii_x - 3)
  793. io[i].oy1=string(50+li_bfsize*3+13)
  794. io[i].ox2=string(ii_x - 3)
  795. io[i].oy2=string(50+li_bfsize*3+14+li_bfsize+8)
  796. if j<=li_rows then
  797. ii_x=ii_x+li_len2+5
  798. if ii_x>ii_x_max then
  799. li_rows=j
  800. end if
  801. end if
  802. next
  803. for j=1 to 3 // 三条横线
  804. iis++
  805. i=iis
  806. io[i].otype='line'
  807. io[i].oname='line1_'+string(i*2 - 2+j)
  808. io[i].ocolor='0'
  809. io[i].ox1=string(2)
  810. io[i].ox2=string(ii_x - 2)
  811. choose case j
  812. case 1
  813. io[i].oy1=string(50+li_bfsize*3 - li_bfsize*3 - 5 - 4)
  814. io[i].oy2=string(50+li_bfsize*3 - li_bfsize*3 - 5 - 4)
  815. case 2
  816. io[i].oy1=string(50+li_bfsize*3 - 2)
  817. io[i].oy2=string(50+li_bfsize*3 - 2)
  818. case 3
  819. io[i].oy1=string(50+li_bfsize*3+14+li_bfsize+8)
  820. io[i].oy2=string(50+li_bfsize*3+14+li_bfsize+8)
  821. end choose
  822. next
  823. wf_band4(50+li_bfsize*3,li_bfsize+10,0,50,0)
  824. case 3,7 //3=自由式
  825. for j=1 to li_rows
  826. li_max1=max(li_max1,dw3.getitemnumber(j,'clen1'))
  827. li_max2=max(li_max2,dw3.getitemnumber(j,'clen2'))
  828. next
  829. if ii_bbgs=7 then
  830. li_ls=1//Label格式只需要1列
  831. else
  832. li_ls=int(800/(li_max1+li_max2+4))//计算列数
  833. if li_ls=0 then li_ls=1
  834. end if
  835. li_hs=Ceiling(li_rows/li_ls)//计算行数
  836. li_hs=min(li_hs,int(870/(li_bfsize+4)))//(行数*行高)不能超过A4打印的范围约870
  837. for j=1 to li_rows
  838. w_rpt_message.event ue_percent(j*100/li_rows)
  839. li_cls=Ceiling(j/li_hs)
  840. li_chs=mod(j,li_hs)
  841. if li_chs=0 then
  842. li_chs=li_hs
  843. end if
  844. iis++
  845. i=iis
  846. is_oexp=dw3.getitemstring(j,'ctag')
  847. is_o2exp=dw3.getitemstring(j,'cname')
  848. io[i].otype='text'//字段标题
  849. io[i].oname=is_o2exp+'_t'
  850. io[i].otext=is_oexp
  851. io[i].oborder='0'
  852. io[i].ocolor='0'
  853. io[i].obcolor='536870912'
  854. io[i].others=io[i].others+'{background.mode=1}'//背景透明
  855. io[i].ox1=string((li_max1+li_max2+8)*(li_cls - 1)+4)
  856. io[i].oy1=string(50+16+(li_chs - 1)*(li_bfsize+4))
  857. io[i].ox2=string(long(io[i].ox1)+dw3.getitemnumber(j,'clen1'))
  858. io[i].oy2=string(long(io[i].oy1)+li_bfsize)
  859. io[i].ofname=ls_bfname
  860. io[i].ofsize=string(li_bfsize)
  861. iis++
  862. i=iis
  863. io[i].otype='column'//字段
  864. io[i].others=io[i].others+'{id='+string(j)+'}'+'{tabsequence='+string(j*10)+'}'
  865. io[i].oname=is_o2exp//'edit_'+string(i)
  866. io[i].otext=is_oexp
  867. io[i].oborder='0'
  868. io[i].ocolor='0'
  869. io[i].obcolor='16777215'
  870. io[i].oexpression='edit'
  871. io[i].ox1=string((li_max1+li_max2+8)*(li_cls - 1)+4+li_max1+4)
  872. io[i].oy1=string(50+16+(li_chs - 1)*(li_bfsize+4))
  873. io[i].ox2=string(long(io[i].ox1)+dw3.getitemnumber(j,'clen2'))
  874. io[i].oy2=string(long(io[i].oy1)+li_bfsize)
  875. io[i].ofname=ls_bfname
  876. io[i].ofsize=string(li_bfsize)
  877. wf_format(dw3.getitemstring(j,'ctype'))
  878. next
  879. wf_band4(50,li_hs*(li_bfsize+4)+2,0,50,0)
  880. if ii_bbgs=7 then
  881. iso='band1'
  882. iio=wf_afind()
  883. wf_aftermove(-49,1)
  884. iso='band4'
  885. iio=wf_afind()
  886. wf_aftermove(-50,1)
  887. f_wsx(id[1].others,'label.width',string(li_max1+li_max2+10))
  888. f_wsx(id[1].others,'label.height',string(li_hs*(li_bfsize+4)))
  889. f_wsx(id[1].others,'label.rows','20')
  890. f_wsx(id[1].others,'label.columns','5')
  891. f_wsx(id[1].others,'label.rows.spacing','2')
  892. f_wsx(id[1].others,'label.columns.spacing','2')
  893. f_wsx(id[1].others,'label.ellipse_height','10')
  894. f_wsx(id[1].others,'label.ellipse_width','10')
  895. else
  896. //添加标题
  897. wf_title(max(((li_max1+li_max2+8)*li_cls+4 - len(is_rname)*li_tfsize/2)/2,0),10,ls_tfname,li_tfsize)
  898. //添加页码
  899. wf_page(min(max(((li_max1+li_max2+8)*li_cls+4 - 38*li_bfsize/2)/2,0),1000),50+li_hs*(li_bfsize+4)+16+24+14,ls_bfname,li_bfsize)
  900. //添加四个带区
  901. end if
  902. end choose
  903. wf_obj0()
  904. goto myband4
  905. return
  906. myband4:
  907. if iis=0 then
  908. wf_band4(50,50,50,50,0)
  909. wf_obj0()
  910. end if
  911. if is_datasource='dw' then
  912. dw3.reset()
  913. lds.rowscopy(1,lds.rowcount(),Primary!,dw3,1,Primary!)
  914. wf_resetoid()
  915. destroy lds
  916. end if
  917. wf_write()//表达式子校验用
  918. if import_flag then
  919. wf_dwimport()
  920. end if
  921. close(w_rpt_message)
  922. end event
  923. event ue_sel_yes;//从菜单中选择对象,参数:select_type
  924. dw1.setredraw(false)
  925. iic=0
  926. for i=1 to iis
  927. if select_type='all' or (pos(io[i].oname,select_type)=1 and pos(select_type,'line')=1) or (pos(select_type,io[i].otype)>0 and pos(select_type,'line')=0) then
  928. iic++//全选或找到,选中
  929. io[i].oselect=string(iic)
  930. else
  931. io[i].oselect=''
  932. end if
  933. next
  934. wf_setcolor()//设置颜色,选中为红色。
  935. dw1.setredraw(true)
  936. end event
  937. event ue_datasource();//重新设置数据源事件
  938. istr_rpt.auto='sql'
  939. openwithparm(w_rpt_sql,istr_rpt,this)
  940. if not isvalid(message.powerobjectparm) then return
  941. istr_rpt=message.powerobjectparm
  942. wf_resetoid()
  943. ii_save=1
  944. wf_write()//表达式子校验用
  945. end event
  946. event ue_deletegroup;//删除分组事件
  947. string ls_obj,ls_group
  948. int li_group
  949. open(w_rpt_groupd)
  950. ls_group=message.StringParm
  951. if ls_group='' then return
  952. ls_obj=iso//保护
  953. //删除组标题区
  954. wf_asort('y1')
  955. iso=ls_group
  956. li_group=long(mid(ls_group,10))
  957. iio=wf_afind()
  958. if iio>0 then
  959. l[1]=0
  960. for i=iio -1 to 1 step -1//反方向找上一带区
  961. if io[i].otype='band' then
  962. l[1]=i
  963. exit
  964. end if
  965. next
  966. if l[1]>0 then
  967. l[2]=long(io[i].oy1)
  968. else
  969. l[2]=0
  970. end if
  971. wf_aftermove(l[2] -long(io[iio].oy1),0)
  972. wf_adelete(iio)
  973. end if
  974. //删除组尾区
  975. iso=f_replace(ls_group,'_g_h','_g_b')
  976. iio=wf_afind()
  977. if iio>0 then
  978. l[1]=0
  979. for i=iio -1 to 1 step -1//反方向找上一带区
  980. if io[i].otype='band' then
  981. l[1]=i
  982. exit
  983. end if
  984. next
  985. if l[1]>0 then
  986. l[2]=long(io[i].oy1)
  987. else
  988. l[2]=0
  989. end if
  990. wf_aftermove(l[2] -long(io[iio].oy1),0)
  991. wf_adelete(iio)
  992. end if
  993. //对组编号重新排序
  994. for i=1 to iis
  995. iso=io[i].oname
  996. l[1]=long(mid(iso,10))
  997. if pos(iso,'band_g_')=1 and l[1]>li_group then
  998. dw1.modify('destroy '+iso)//删除原来分组
  999. io[i].oname=left(iso,9)+string(l[1] -1)
  1000. io[i].otext=f_replace(io[i].otext,string(l[1])+': ',string(l[1] -1)+': ')
  1001. end if
  1002. next
  1003. for i=1 to iis
  1004. iso=io[i].oname
  1005. l[1]=long(mid(iso,10))
  1006. if pos(iso,'band_g_')=1 and l[1]>=li_group then
  1007. wf_object(i,0)//不能把此循环跟上一循环合并
  1008. end if
  1009. next
  1010. ii_group --
  1011. iso=ls_obj
  1012. iio=wf_afind()
  1013. wf_write()//表达式子校验用
  1014. end event
  1015. event ue_delobj;//删除被选中的全部非带区对象
  1016. dw1.setredraw(false)
  1017. for i=iis to 1 step -1//循环删除所有选中对象
  1018. if io[i].oselect<'1' or io[i].otype='band' then continue
  1019. wf_adelete(i)
  1020. next
  1021. dw1.setredraw(true)
  1022. end event
  1023. event ue_insertgroup;//增加分组代码
  1024. string ls_obj
  1025. ls_obj=iso
  1026. open(w_rpt_groupc)
  1027. s[3]=message.StringParm
  1028. if s[3]='' or s[3]=';;' then return
  1029. l[1]=pos(s[3],';;')
  1030. if l[1]>0 then
  1031. s[1]=left(s[3],l[1] - 1)
  1032. s[2]=mid(s[3],l[1]+2)
  1033. end if
  1034. wf_insertgroup(0,0,s[1],s[2],'no','no',0)//分组头高,分组尾高,中文名,英文名
  1035. iso=ls_obj
  1036. wf_write()//表达式子校验用
  1037. end event
  1038. event ue_properties;choose case iic
  1039. case 1 //选了1个对象
  1040. dwobject ldwo
  1041. dw1.event doubleclicked(0,0,0,ldwo)
  1042. case 0 //选了0个对象,修改datawindow属性
  1043. if tt='crosstab' and istr_rpt.rarguments>'' then//交叉报表数据源带参数情况
  1044. istr_rpt.auto='sql'
  1045. istr_rpt.tt=tt+'_auto'
  1046. openwithparm(w_rpt_sql,istr_rpt,this)
  1047. if isvalid(message.powerobjectparm) then istr_rpt=message.powerobjectparm
  1048. end if
  1049. istr_rpt.tt=tt
  1050. dw1.event doubleclicked(0,0,0,dw1.object.datawindow)
  1051. istr_rpt.tt=''
  1052. case else
  1053. messagebox('信息','请先选择一个对象!')
  1054. end choose
  1055. end event
  1056. event ue_outside;if keydown(KeyLeftButton!) then
  1057. choose case ii_outside
  1058. case 1//右边界
  1059. ii_temp=8
  1060. if ii_x+ii_temp<=ii_x_max then
  1061. dw1.event ScrollHorizontal(ii_x_scroll+ii_temp,2)//触发dw_1的水平滚动事件,下同
  1062. dw1.object.DataWindow.HorizontalScrollPosition=string(ii_x_scroll)
  1063. dw1.event ue_mousemove(ii_x - (ii_x_scroll - ii_temp),ii_y - ii_y_scroll,0,dw1.object.datawindow)//dw_1的鼠标移动事件,用以选择对象,下同.
  1064. end if
  1065. case 2//下边界
  1066. ii_temp=8
  1067. if ii_y+ii_temp<=ii_y_max then
  1068. dw1.event ScrollVertical(ii_y_scroll+ii_temp)
  1069. dw1.object.DataWindow.VerticalScrollPosition=string(ii_y_scroll)
  1070. dw1.event ue_mousemove(ii_x - ii_x_scroll,ii_y - (ii_y_scroll - ii_temp),0,dw1.object.datawindow)
  1071. end if
  1072. case 3//左边界
  1073. ii_temp=-8
  1074. if ii_x_scroll>0 then
  1075. if ii_x_scroll<abs(ii_temp) then ii_temp= - ii_x_scroll
  1076. dw1.event ScrollHorizontal(ii_x_scroll+ii_temp,2)
  1077. dw1.object.DataWindow.HorizontalScrollPosition=string(ii_x_scroll)
  1078. dw1.event ue_mousemove(0,ii_y - ii_y_scroll,0,dw1.object.datawindow)
  1079. else
  1080. dw1.event ue_mousemove(0,ii_y - ii_y_scroll,0,dw1.object.datawindow)
  1081. end if
  1082. case 4//上边界
  1083. ii_temp=-8
  1084. if ii_y_scroll>0 then
  1085. if ii_y_scroll<abs(ii_temp) then ii_temp= - ii_y_scroll
  1086. dw1.event ScrollVertical(ii_y_scroll+ii_temp)
  1087. dw1.object.DataWindow.VerticalScrollPosition=string(ii_y_scroll)
  1088. dw1.event ue_mousemove(ii_x - ii_x_scroll,0,0,dw1.object.datawindow)
  1089. else
  1090. dw1.event ue_mousemove(ii_x - ii_x_scroll,0,0,dw1.object.datawindow)
  1091. end if
  1092. end choose
  1093. end if
  1094. ii_outside=0
  1095. end event
  1096. event ue_cc;dw1.setredraw(false)
  1097. long l1
  1098. l1=wf_occ(1)//最大值
  1099. if ai_cc=1 then//放到最上层
  1100. for i=1 to iis
  1101. if io[i].oselect<'1' or io[i].otype='band' then continue
  1102. dw1.modify('destroy '+io[i].oname)
  1103. wf_object(i,0)//根据对象不同分别生成Modify语句并执行
  1104. l1++
  1105. io[i].occ=l1
  1106. next
  1107. wf_setcolor()
  1108. wf_asort('cc')
  1109. else
  1110. for i=1 to iis
  1111. if io[i].oselect>'0' or io[i].otype='band' then continue
  1112. dw1.modify('destroy '+io[i].oname)
  1113. wf_object(i,0)//根据对象不同分别生成Modify语句并执行
  1114. l1++
  1115. io[i].occ=l1
  1116. next
  1117. wf_setcolor()
  1118. wf_asort('cc')
  1119. end if
  1120. dw1.setredraw(true)
  1121. end event
  1122. event ue_edit_report();IF io[iio].otype = 'report' THEN
  1123. str_rpt s_rpt_parm
  1124. s_rpt_parm.auto = "auto"
  1125. s_rpt_parm.transation = sqlca //数据库连接
  1126. s_rpt_parm.oname = io[iio].otext
  1127. s_rpt_parm.otype = istr_rpt.otype
  1128. s_rpt_parm.rcname = io[iio].otext
  1129. s_rpt_parm.retr_pram_falg = -1
  1130. s_rpt_parm.retr_flag = TRUE
  1131. s_rpt_parm.import_flag = TRUE
  1132. s_rpt_parm.pblpath = istr_rpt.pblpath
  1133. window lw_win
  1134. OpenWithParm(lw_win,s_rpt_parm,this.ClassName())
  1135. lw_win.WindowState = Normal!
  1136. END IF
  1137. end event
  1138. event ue_upload(); //语法保存
  1139. wf_resetoid()
  1140. if wf_write() = 0 then return
  1141. String arg_msg
  1142. IF wf_upload(is_dw,arg_msg) = 0 THEN
  1143. MessageBox('错误',arg_msg)
  1144. ELSE
  1145. MessageBox('提示','上传文件成功!')
  1146. END IF
  1147. end event
  1148. event ue_saveupload();triggerevent('ue_beforesave')
  1149. //语法保存
  1150. wf_resetoid()
  1151. if wf_write() = 0 then return
  1152. Blob lblob
  1153. lblob = Blob(is_dw,EncodingANSI!)
  1154. IF NOT import_flag THEN
  1155. //PB6.5(或PB7.0)+MSSQL2000下需要加上以下两行代码才不会出错,但PB8.0则可以不加
  1156. UPDATE u_report_list Set Rpsyntax = '' Where rpid = :is_rid USING it_report;
  1157. COMMIT USING it_report;
  1158. UPDATE u_report_list
  1159. SET flag = 1
  1160. Where rpid = :is_rid USING it_report;
  1161. UPDATEBLOB u_report_list
  1162. Set Rpsyntax = :lblob
  1163. Where rpid = :is_rid USING it_report;
  1164. //if it_report.sqlnrows>0 then//PB8.0可以开放以下代码
  1165. IF it_report.SQLCode = 0 THEN
  1166. COMMIT USING it_report;
  1167. ii_save = 0
  1168. MessageBox('提示','保存成功!')
  1169. ib_save_flag = TRUE
  1170. ELSE
  1171. ROLLBACK USING it_report;
  1172. MessageBox('error!','保存失败!'+it_report.SQLErrText)
  1173. END IF
  1174. ELSE
  1175. ///直接写入当前PBL
  1176. String ls_error
  1177. IF is_rname > '' THEN
  1178. Long rslt
  1179. IF ls_comments <> '' THEN
  1180. rslt = LibraryImport(ls_pblpath,is_rname,ImportDataWindow!,is_dw,ls_error,ls_comments)
  1181. ELSE
  1182. rslt = LibraryImport(ls_pblpath,is_rname,ImportDataWindow!,is_dw,ls_error)
  1183. END IF
  1184. IF rslt = 1 THEN
  1185. IF IsValid(w_publ_preview) THEN
  1186. Long j
  1187. FOR j = 1 TO w_publ_preview.it_max
  1188. IF w_publ_preview.ls_dw_arr[j] = is_rname THEN
  1189. w_publ_preview.wf_dowithm(22)
  1190. EXIT
  1191. END IF
  1192. NEXT
  1193. END IF
  1194. String arg_msg
  1195. IF wf_upload(is_dw,arg_msg) = 0 THEN
  1196. MessageBox('错误',arg_msg)
  1197. ELSE
  1198. MessageBox('提示','保存并上传成功!')
  1199. END IF
  1200. ELSE
  1201. MessageBox('提示','保存失败!' +ls_error)
  1202. END IF
  1203. ELSE
  1204. MessageBox('提示','保存失败!')
  1205. END IF
  1206. END IF
  1207. triggerevent('ue_aftersave')
  1208. RETURN
  1209. end event
  1210. event ue_beforesave();// 保存之前去除背景
  1211. String ls_type = ''
  1212. Long ll_pos
  1213. String ls_units
  1214. ls_units = dw1.Describe("DataWindow.Units")
  1215. Int rslt = 1
  1216. String arg_msg
  1217. Blob back_data
  1218. FOR i = 1 To iis
  1219. IF io[i].oname = ibackgroudname THEN
  1220. EXIT
  1221. END IF
  1222. NEXT
  1223. IF i <= iis THEN
  1224. s_tran.X = wf_unitsx_to_mm(ls_units, Double(io[i].ox1))
  1225. s_tran.Y = wf_unitsx_to_mm(ls_units, Double(io[i].oy1))
  1226. s_tran.Width = wf_unitsx_to_mm(ls_units, Double(io[i].ox2) - Double(io[i].ox1))
  1227. s_tran.Height = wf_unitsx_to_mm(ls_units, Double(io[i].oy2) - Double(io[i].oy1))
  1228. s_tran.Filename = io[i].otext
  1229. IF s_tran.Filename <> ifilename THEN
  1230. IF f_filetoblob(s_tran.Filename, Ref back_data, Ref arg_msg) <> 1 THEN
  1231. rslt = 0
  1232. GOTO ext
  1233. END IF
  1234. END IF
  1235. ll_pos = lastpos(s_tran.Filename, '.')
  1236. IF ll_pos > 0 THEN
  1237. ls_type = Mid(s_tran.Filename, ll_pos + 1)
  1238. END IF
  1239. UPDATE sys_dwprint_background
  1240. SET back_x = :s_tran.x,
  1241. back_y = :s_tran.y,
  1242. back_width = :s_tran.width,
  1243. back_height = :s_tran.height,
  1244. back_type = :ls_type
  1245. Where dwname = :is_rname;
  1246. IF sqlca.SQLCode <> 0 THEN
  1247. rslt = 0
  1248. arg_msg = '保存背景图失败,' + sqlca.SQLErrText
  1249. GOTO ext
  1250. END IF
  1251. IF sqlca.SQLNRows = 0 THEN
  1252. INSERT INTO sys_dwprint_background(
  1253. dwname,
  1254. back_x,
  1255. back_y,
  1256. back_width,
  1257. back_height,
  1258. back_type)
  1259. VALUES(
  1260. :is_rname,
  1261. :s_tran.x,
  1262. :s_tran.y,
  1263. :s_tran.width,
  1264. :s_tran.height,
  1265. :ls_type);
  1266. IF sqlca.SQLCode <> 0 THEN
  1267. rslt = 0
  1268. arg_msg = '插入背景图失败,' + sqlca.SQLErrText
  1269. GOTO ext
  1270. END IF
  1271. END IF
  1272. COMMIT;
  1273. IF s_tran.Filename <> ifilename THEN
  1274. UpdateBlob sys_dwprint_background
  1275. Set back_data = :back_data
  1276. Where dwname = :is_rname;
  1277. IF sqlca.SQLCode <> 0 THEN
  1278. rslt = 0
  1279. arg_msg = '保存背景图数据失败,' + sqlca.SQLErrText
  1280. GOTO ext
  1281. END IF
  1282. END IF
  1283. END IF
  1284. ext:
  1285. IF i <= iis THEN
  1286. dw1.SetRedraw(False)
  1287. wf_adelete(i)
  1288. dw1.SetRedraw(True)
  1289. s_tran.ifok = 1
  1290. ELSE
  1291. s_tran.ifok = 0
  1292. END IF
  1293. IF rslt = 1 THEN
  1294. COMMIT;
  1295. ELSE
  1296. ROLLBACK;
  1297. MessageBox('ERROR', arg_msg)
  1298. END IF
  1299. end event
  1300. event ue_aftersave();
  1301. String ls_units
  1302. IF s_tran.ifok = 0 THEN RETURN
  1303. ls_units = dw1.Describe("DataWindow.Units")
  1304. iis++
  1305. iio = iis
  1306. io[iio].oname = ibackgroudname
  1307. io[iio].occ = wf_occ(1)+1
  1308. iic = 1
  1309. io[iio].oselect = '1'
  1310. i = iio
  1311. io[i].otext = s_tran.Filename
  1312. s_tran.X = wf_mm_to_unitsx(ls_units, s_tran.X)
  1313. s_tran.Width = wf_mm_to_unitsx(ls_units, s_tran.Width)
  1314. s_tran.Y = wf_mm_to_unitsy(ls_units, s_tran.Y)
  1315. s_tran.Height = wf_mm_to_unitsy(ls_units, s_tran.Height)
  1316. io[i].ox1 = String(s_tran.X)
  1317. io[i].oy1 = String(s_tran.Y)
  1318. io[i].ox2 = String(Double(io[i].ox1)+s_tran.Width)
  1319. io[i].oy2 = String(Double(io[i].oy1)+s_tran.Height)
  1320. io[i].oborder = '2'
  1321. io[i].otype = 'bitmap'
  1322. io[i].oband = is_band
  1323. wf_object(i,0)
  1324. wf_setcolor()
  1325. This.Trigger Event ue_cc(0)
  1326. end event
  1327. public subroutine wf_setcolor ();dw1.setredraw(false)
  1328. string ls
  1329. for i=1 to iis
  1330. if long(io[i].oselect)>0 then//选择的序号>0
  1331. choose case io[i].otype
  1332. case 'line','rectangle','ellipse','roundrectangle'
  1333. ls=ls+' '+io[i].oname+".pen.color='255'"
  1334. case 'text','column','compute','band','tableblob','report','button','groupbox'
  1335. ls=ls+' '+io[i].oname+".color='255'"
  1336. case 'bitmap','graph'
  1337. ls=ls+' '+io[i].oname+".border='5'"
  1338. end choose
  1339. else
  1340. choose case io[i].otype
  1341. case 'line','rectangle','ellipse','roundrectangle'
  1342. ls=ls+' '+io[i].oname+".pen.color='"+io[i].ocolor+"'"
  1343. case 'text','column','compute','button','groupbox'
  1344. ls=ls+' '+io[i].oname+".color='"+io[i].ocolor+"'"
  1345. case 'tableblob','report','band'
  1346. ls=ls+' '+io[i].oname+".color='0'"
  1347. case 'bitmap','graph'
  1348. ls=ls+' '+io[i].oname+".border='"+io[i].oborder+"'"
  1349. end choose
  1350. end if
  1351. next
  1352. if ls>'' then dw1.modify(ls)
  1353. //messagebox('',ls)
  1354. sle_1.text=''
  1355. sle_1.enabled=false
  1356. sle_1.backcolor=80269524
  1357. if NOT IsValid(m_rpt_main) then
  1358. m_rpt_main = lm_rpt_main
  1359. end if
  1360. m_rpt_main.m_xs.m_left.Checked=false
  1361. m_rpt_main.m_xs.m_center.Checked=false
  1362. m_rpt_main.m_xs.m_right.Checked=false
  1363. m_rpt_main.m_xs.m_ct.Checked=false
  1364. m_rpt_main.m_xs.m_xt.Checked=false
  1365. m_rpt_main.m_xs.m_xhx.Checked=false
  1366. if iic=1 then
  1367. if iio=0 then//在ue_sel_yes和dw1.event ue_lbuttonup中的temp有这种情况
  1368. for i=1 to iis
  1369. if io[i].oselect>'0' then
  1370. iio=i
  1371. exit
  1372. end if
  1373. next
  1374. end if
  1375. if iio=0 then return
  1376. i=iio
  1377. dwc1.object.qjs.background.color=string(long(io[i].ocolor))
  1378. if pos('rectangle,ellipse,roundrectangle',io[i].otype)>0 then
  1379. dwc1.object.bjs.background.color=string(long(io[i].ofname))
  1380. else
  1381. dwc1.object.bjs.background.color=string(long(io[i].obcolor))
  1382. end if
  1383. f_statbar('t2','对象名:'+iso+' 类型:'+io[i].otype)
  1384. if pos('text,column,compute,button,groupbox',io[i].otype)>0 then
  1385. ddlb_1.text=io[i].ofname
  1386. ddlb_2.text=string(round(long(io[i].ofsize)*3/4,0))
  1387. if pos('text,groupbox',io[i].otype)>0 then
  1388. sle_1.text=io[i].otext
  1389. sle_1.enabled=true
  1390. sle_1.backcolor=16777215
  1391. end if
  1392. if long(io[i].ofweight)>400 then m_rpt_main.m_xs.m_ct.Checked=true//weight=700粗体
  1393. if long(io[i].ofitalic)>0 then m_rpt_main.m_xs.m_xt.Checked=true//italic=1斜体
  1394. if long(io[i].ofunderline)>0 then m_rpt_main.m_xs.m_xhx.Checked=true//underline=1下划线
  1395. if pos('text,column,compute',io[i].otype)>0 then
  1396. choose case io[i].oalignment
  1397. case '0'//左
  1398. m_rpt_main.m_xs.m_left.Checked=true
  1399. case '2'//中
  1400. m_rpt_main.m_xs.m_center.Checked=true
  1401. case '1'//右
  1402. m_rpt_main.m_xs.m_right.Checked=true
  1403. end choose
  1404. end if
  1405. end if
  1406. else
  1407. f_statbar('t2','选中对象个数:'+string(iic))
  1408. end if
  1409. dw1.setredraw(true)
  1410. end subroutine
  1411. public function integer wf_topformove ();int li
  1412. ii_temp=-1//0
  1413. for li=1 to iis//背景图可能会跨越三个带区
  1414. if long(io[li].oy2)<long(io[iio].oy1) and pos(',foreground,background,',','+io[li].oband+',')=0 then
  1415. ii_temp=max(ii_temp,long(io[li].oy2))
  1416. end if
  1417. next
  1418. return ii_temp
  1419. end function
  1420. public function string wf_arguments (string s_syntax);long ll1,ll2
  1421. ll1=pos(lower(s_syntax),' arguments=')//PB6.5没有table.arguments属性,PB8.0就有了,不过是只读属性
  1422. if ll1>0 then
  1423. ll2=pos(s_syntax,'))',ll1)
  1424. return mid(s_syntax,ll1+11,ll2 -ll1 -9)
  1425. else
  1426. return ''
  1427. end if
  1428. end function
  1429. public subroutine wf_read (string f_label);string ls_objs,ls_syntax1,ls_syntax2,ls_add
  1430. int j,k,m,n,o,p,q,li_tables
  1431. string ls[],ls1,ls2,ls3
  1432. istr_rpt.rdata=wf_mysx('datawindow.data')//因为wf_unit()有时要ids.create(),这样会丢掉此属性,所以要放在此函数之前
  1433. wf_unit()
  1434. ls_syntax1=ids.describe('DataWindow.Syntax')//改为直接等于is_dw时,分组属性by有时读取不到
  1435. ls_syntax2=lower(ls_syntax1)
  1436. s[1]=f_replace(trim(wf_mysx('datawindow.table.select')),'~~~"','')
  1437. istr_rpt.rsqlselect=s[1]
  1438. if s[1]>'' then//
  1439. f_rpt_cksql(s[1],s[2],s[3],s[4],s[5],s[6])//s[3]=tables
  1440. if pos(s[3],',')+pos(s[3],'=')>0 then
  1441. li_tables=2
  1442. end if
  1443. end if
  1444. is_updatetable=wf_mysx('datawindow.table.UpdateTable')
  1445. is_updatewhere=wf_mysx('datawindow.table.UpdateWhere')
  1446. if is_updatewhere='' then is_updatewhere='1'
  1447. is_updatekeyinplace=wf_mysx('datawindow.table.UpdateKeyinPlace')
  1448. if is_updatekeyinplace='' then is_updatekeyinplace='2'
  1449. istr_rpt.rprocedure=wf_mysx('datawindow.table.procedure')
  1450. istr_rpt.rarguments=wf_arguments(ls_syntax1)//PB6.5没有table.arguments属性,PB8.0就有了,不过是只读属性
  1451. is_sparse=wf_mysx('DataWindow.Sparse')
  1452. ls_objs=ids.describe('datawindow.objects')+'~t'
  1453. id[1].ofweight=ids.describe('DataWindow.rows_per_detail')//此属性要先取,因为后面要用到来判断n-up报表,主要原因是column的row_in_detail属性取不到
  1454. if f_label='all' then
  1455. if ls_objs='~t' then
  1456. wf_band4(50,50,50,50,0)//如果没有任何对象,调用wf_band4增加页表头,细节,页表尾4个带区
  1457. wf_dwinit()
  1458. return
  1459. end if
  1460. wf_band4(0,0,0,0,1)
  1461. for j=1 to 99//读取分组信息,用分解字符串方法
  1462. s[1]=ids.Describe("DataWindow.header."+String(j)+".height")
  1463. IF IsNumber(s[1]) THEN
  1464. s[2]=ids.Describe("DataWindow.trailer."+String(j)+".height")
  1465. l[6]=Pos(ls_syntax2,"by=(",Pos(ls_syntax2,"group(level="+String(j)))
  1466. l[7]=Pos(ls_syntax2, '" ) ',l[6])//by后面以'" ) '结束
  1467. if l[7]=0 then l[7]=Pos(ls_syntax2, '" ) ',l[6])//pb8.02中by后面以'" ) '结束
  1468. s[3]=Mid(ls_syntax1,l[6]+5,l[7] -l[6] - 5)
  1469. s[4]=ids.Describe("DataWindow.header."+String(j)+".pointer")//分组的中文信息放在header.pointer属性中
  1470. if s[4]='?' or pos(s[4],'!')>0 then s[4]=s[3]//?为原来没有pointer属性(PB的正常属性如:Help!)
  1471. l[8]=long(s[1])
  1472. l[9]=long(s[2])
  1473. l[6]=Pos(ls_syntax2,"group(level="+String(j))//以下几行为求newpage
  1474. l[7]=Pos(ls_syntax2,")"+char(13),l[6])
  1475. if pos(mid(ls_syntax2,l[6],l[7] -l[6]),'newpage=yes')>0 then
  1476. s[5]='yes'
  1477. else
  1478. s[5]='no'
  1479. end if
  1480. if pos(mid(ls_syntax2,l[6],l[7] -l[6]),'resetpagecount=yes')>0 then
  1481. s[6]='yes'
  1482. else
  1483. s[6]='no'
  1484. end if
  1485. wf_insertgroup(l[8],l[9],s[4],s[3],s[5],s[6],1)//分组头高,分组尾高,中文名,英文名,newpage属性,
  1486. else
  1487. exit
  1488. end if
  1489. next
  1490. end if
  1491. wf_asort('y1')
  1492. for i=iis to 2 step -1//ls_add={带区=y增加值}
  1493. ls_add=ls_add+'{'+io[i].oband+'='+string(long(io[i -1].oy1)+13)+'}'
  1494. next
  1495. dw3.reset()
  1496. ///20090725 zqh
  1497. string ls_dw,ls_rarguments
  1498. ls_dw = istr_rpt.rsqlselect
  1499. ls_rarguments = istr_rpt.rarguments
  1500. //此处替换了参数,如果有子报表,且传入的是该参数时,可能导致传入子报表的参数为NULL,提示出错
  1501. string ss[]
  1502. long ll[]
  1503. ls_rarguments = mid(ls_rarguments,2)
  1504. do while 1=1//重新标记参数
  1505. ll[1]=pos(ls_rarguments,'(')
  1506. ll[2]=pos(ls_rarguments,',',ll[1])
  1507. ll[3]=pos(ls_rarguments,')',ll[1])
  1508. if ll[1]<1 then exit
  1509. ss[1]=trim(mid(ls_rarguments,ll[1]+2,ll[2] -ll[1] -3))
  1510. ss[2]=trim(mid(ls_rarguments,ll[2]+1,ll[3] -ll[2] -1))
  1511. ls_rarguments=mid(ls_rarguments,ll[3]+1)
  1512. choose case ss[2]
  1513. case 'date'
  1514. ss[5]=string(today())
  1515. ls_dw=f_replace(ls_dw,':'+ss[1],"'"+ss[5]+"'")
  1516. case 'datetime'
  1517. ss[5]=string(now())
  1518. ls_dw=f_replace(ls_dw,':'+ss[1],"'"+ss[5]+"'")
  1519. case 'time'
  1520. ss[5]=string(time(now()))
  1521. ls_dw=f_replace(ls_dw,':'+ss[1],"'"+ss[5]+"'")
  1522. case 'string','number'
  1523. ss[5]='0'
  1524. ls_dw=f_replace(ls_dw,':'+ss[1],ss[5])
  1525. case else
  1526. ss[5]='0'
  1527. ls_dw=f_replace(ls_dw,':'+ss[1],ss[5])
  1528. end choose
  1529. loop
  1530. //f_rpt_gdw_lwl(ids,dw3,it_report,'','')
  1531. f_rpt_gdw(ls_dw,dw3,it_report,'','')
  1532. ////
  1533. //l[6]=long(ids.describe('DataWindow.Column.Count'))
  1534. //for i=1 to l[6]//为了在下面分解COLUMN直接SETITEM,以便行号跟oid对应
  1535. // s[9]='#'+string(i)
  1536. // s[1]=ids.describe(s[9]+'.coltype')
  1537. // if s[1]='blob' then continue//blob的column应该是放在最后,所以不会影响其他的id
  1538. // dw3.insertrow(0)
  1539. // dw3.object.ctype[i]=s[1]
  1540. // dw3.object.cupdate[i]=ids.describe(s[9]+'.update')
  1541. // dw3.object.cwhereclause[i]=ids.describe(s[9]+'.updatewhereclause')
  1542. // dw3.object.ckey[i]=ids.describe(s[9]+'.key')
  1543. // dw3.object.cidentity[i]=ids.describe(s[9]+'.identity')
  1544. // s[1]=ids.describe(s[9]+'.dbname')
  1545. // dw3.object.cdbname[i]=s[1]
  1546. // s[1]=ids.describe(s[9]+'.name')//此语句对于N-UP取出来的name不理想
  1547. // dw3.object.cname[i]=s[1]
  1548. // dw3.object.cinitial[i]=ids.describe(s[9]+'.initial')
  1549. // dw3.object.cvalidation[i]=wf_mysx(s[9]+'.validation')
  1550. // dw3.object.cvalidationmsg[i]=wf_mysx(s[9]+'.validationmsg')
  1551. // s[1]=wf_mysx(s[9]+'.values')//s[1]值在下面要用到,跟下一行不能合并为一行
  1552. // dw3.object.cvalues[i]=s[1]
  1553. // s[2]=ids.describe(s[9]+'.tag')
  1554. // if left(s[2],1)='"' and right(s[2],1)='"' then
  1555. // s[2]=mid(s[2],2,len(s[2]) -2)//在access数据库下且字段名为英文注释时发现多加双引号"的情况
  1556. // end if
  1557. // if pos(s[2],char(9))>0 then s[2]=left(s[2],pos(s[2],char(9)) -1)
  1558. // if pos('?!',s[2])>0 then
  1559. // if s[1]>'' then
  1560. // if pos(s[1],char(9))>0 then s[1]=left(s[1],pos(s[1],char(9)) -1)
  1561. // s[2]=s[1]
  1562. // else
  1563. // if istr_rpt.datasource='dw' then//前台报表取中文信息
  1564. // s[1]=ids.describe(dw3.object.cname[i]+'_t.text')
  1565. // if pos('?!',s[1])>0 then
  1566. // s[2]=dw3.object.cname[i]
  1567. // else
  1568. // s[2]=s[1]
  1569. // end if
  1570. // else
  1571. // s[2]=dw3.object.cname[i]
  1572. // end if
  1573. // end if
  1574. // end if
  1575. // dw3.object.ctag[i]=s[2]
  1576. //next
  1577. //
  1578. f_atab(ls[],ls_objs+'datawindow~t')
  1579. k=upperbound(ls[])
  1580. for m=1 to k
  1581. iis++
  1582. i=iis
  1583. io[i].occ=i//用于对象层次
  1584. is_type=ids.describe(ls[m]+'.type')
  1585. o=long(mid(ist,pos(ist,is_type) -2,2))
  1586. p=ii[2*o -1]+1//type已取
  1587. q=ii[2*o]
  1588. ls3=''
  1589. j=1
  1590. io[i].otype=is_type//type已取
  1591. for o=p to q
  1592. j++
  1593. if j>19 then//为了加快速度
  1594. choose case is_type
  1595. case 'column'
  1596. ii_temp=idsx.object.data[o,2]
  1597. if ii_temp>=41 and ii_temp<=124 then//为了加快速度
  1598. if pos(is0[o],io[i].oexpression+'.')=0 then continue
  1599. end if
  1600. case 'datawindow'
  1601. ii_temp=idsx.object.data[o,2]
  1602. choose case io[i].ox1
  1603. case '1'//grid
  1604. if ii_temp>40 then continue
  1605. case '2'//label
  1606. if ii_temp>20 and ii_temp<51 then continue
  1607. case '4'//crosstab
  1608. if ii_temp>50 then continue
  1609. case else//'0'
  1610. if ii_temp>20 then continue
  1611. end choose
  1612. end choose
  1613. end if
  1614. ls1=ids.describe(ls[m]+'.'+is0[o])
  1615. if left(ls1,1)='"' then ls1=mid(ls1,2,len(ls1) -2)//有待检验
  1616. if j=3 and ls1='?' then//band='?',此字段column已经删除
  1617. iis --
  1618. exit
  1619. elseif j>3 and j<19 then//4到18属性在tab处分开
  1620. ii_temp=pos(ls1,char(9))
  1621. if ii_temp>0 then
  1622. ls2=mid(ls1,ii_temp+1)
  1623. ls1=left(ls1,ii_temp -1)
  1624. else
  1625. ls2=''
  1626. end if
  1627. end if
  1628. if pos('?!',ls1)>0 then
  1629. ls1=''
  1630. if id[1].ofweight>'1' and is0[o]='row_in_detail' then//PB中row_in_detail属性取不到
  1631. ls1=wf_rowindetail(ls_syntax2,ls[m])
  1632. end if
  1633. end if
  1634. choose case j//type已取
  1635. case 2
  1636. io[i].oname=ls1
  1637. case 3
  1638. io[i].oband=ls1
  1639. case 4
  1640. io[i].ox1=ls1
  1641. case 5
  1642. io[i].oy1=ls1
  1643. case 6
  1644. io[i].ox2=ls1
  1645. case 7
  1646. io[i].oy2=ls1
  1647. case 8
  1648. io[i].oborder=ls1
  1649. case 9
  1650. io[i].otext=ls1
  1651. case 10
  1652. io[i].ocolor=ls1
  1653. case 11
  1654. io[i].obcolor=ls1
  1655. case 12
  1656. io[i].ofname=ls1
  1657. case 13
  1658. io[i].ofsize=ls1
  1659. case 14
  1660. io[i].ofweight=ls1
  1661. case 15
  1662. io[i].ofitalic=ls1
  1663. case 16
  1664. io[i].ofunderline=ls1
  1665. case 17
  1666. io[i].oalignment=ls1
  1667. case 18
  1668. io[i].oexpression=ls1
  1669. case else//>=19
  1670. ls2=ls1
  1671. end choose
  1672. if j>3 and pos('?!',ls2)=0 and ls2>'' then
  1673. ls3=ls3+'{'+is0[o]+'='+ls2+'}'
  1674. end if
  1675. next
  1676. io[i].others=ls3
  1677. if is_type='tableblob' then
  1678. io[i].ocolor=ids.describe('#'+io[i].ofweight+'.dbname')//ocolor='dbname',ofweight='id'
  1679. end if
  1680. if is_type='datawindow' then
  1681. if io[i].ox1='4' then//crosstab,在ids没有retrieve()时,crosstab.staticmode取不到属性,crosstab.dynamic则一直取不到属性,只能用分解字符串的办法
  1682. if pos(ls_syntax2,'crosstab.dynamic=yes')+pos(ls_syntax2,'crosstab.dynamic = yes')>0 then//crosstab动态模式
  1683. f_wsx(io[i].others,'crosstab.dynamic','yes')
  1684. else//crosstab静态模式
  1685. l[1]=pos(ls_syntax2,'crosstabdata=')
  1686. l[2]=pos(ls_syntax2,'retrieve=',l[1])//??procedure是否适合
  1687. f_wsx(io[i].others,'crosstabdata',trim(mid(ls_syntax2,l[1],l[2] -l[1])))
  1688. end if
  1689. end if
  1690. continue//避免执行oy1,oy2的加长处理
  1691. elseif is_type<>'line' then
  1692. io[i].ox2=string(long(io[i].ox2)+long(io[i].ox1))//x2
  1693. io[i].oy2=string(long(io[i].oy2)+long(io[i].oy1))//y2
  1694. elseif pos(ls[m],'line2')=1 then//竖线反修正
  1695. if io[i].oy1='-1' then io[i].oy1='0'//wf_write中io[i].oy1='-1'
  1696. if io[i].oband='header' then io[i].oy2=string(long(io[i].oy2) -1)//wf_write中io[i].oy2=string(long(io[i].oy2)+1
  1697. end if
  1698. ii_temp=long(f_rsx(ls_add,io[i].oband))
  1699. if ii_temp>0 then
  1700. io[i].oy1=string(long(io[i].oy1)+ii_temp)
  1701. io[i].oy2=string(long(io[i].oy2)+ii_temp)
  1702. end if
  1703. next
  1704. id[1]=io[iis]//datawindow属性
  1705. io[iis]=id[2]//清空最后一行
  1706. iis --
  1707. end subroutine
  1708. public subroutine wf_resetoid ();for i=1 to iis//对type,oid重新设置
  1709. if pos('column,compute',io[i].otype)>0 then
  1710. if io[i].otype='column' then
  1711. s[1]=io[i].oname
  1712. else
  1713. if f_rsx(io[i].others,'id')>'' then//本来是字段,但重新设置数据源不小心删除后,如果重新加上,则用是否有id号来判断
  1714. s[1]=io[i].oname//这种情况io[i].oexpression='edit','checkbox'等
  1715. else
  1716. s[1]=io[i].oexpression
  1717. end if
  1718. end if
  1719. l[1]=dw3.find("cname='"+f_replace(s[1],"'","~~~'")+"'",1,999)
  1720. if l[1]>0 then
  1721. io[i].otype='column'
  1722. f_wsx(io[i].others,'id',string(l[1]))
  1723. else
  1724. io[i].otype='compute'
  1725. end if
  1726. end if
  1727. next
  1728. end subroutine
  1729. public subroutine wf_allset (string f_set, string f_new);//所选对象设置字体,字号等,参数:f_set
  1730. dw1.setredraw(false)
  1731. for i=1 to iis//循环处理所有对象
  1732. if io[i].oselect<'1' then continue
  1733. if pos(f_set,'color')>0 then//color or bcolor
  1734. if pos('text,column,compute,button,line,rectangle,groupbox,ellipse,roundrectangle',io[i].otype)=0 then continue
  1735. elseif pos(f_set,'border')>0 then
  1736. if pos('text,column,compute,graph,bitmap,groupbox',io[i].otype)=0 then continue
  1737. elseif pos(f_set,'align')>0 then
  1738. if pos('text,column,compute',io[i].otype)=0 then continue
  1739. else//fname,fsize,weight,italic,underline
  1740. if pos('text,column,compute,button,roundrectangle,groupbox',io[i].otype)=0 then continue
  1741. end if
  1742. choose case f_set
  1743. case 'fname'//字体
  1744. io[i].ofname=f_new
  1745. case 'fsize'//字号
  1746. io[i].ofsize=string(round(long(f_new)*4/3,0))
  1747. case 'align'//居左中右
  1748. io[i].oalignment=f_new
  1749. case 'border'//边框
  1750. io[i].oborder=f_new
  1751. case 'color'//前景色
  1752. io[i].ocolor=f_new
  1753. case 'bcolor'//背景色
  1754. if pos('rectangle,ellipse,roundrectangle',io[i].otype)>0 then
  1755. io[i].ofname=f_new//brush.color
  1756. else
  1757. io[i].obcolor=f_new
  1758. end if
  1759. case 'weight'//粗体
  1760. io[i].ofweight=f_new
  1761. case 'italic'//斜体
  1762. io[i].ofitalic=f_new
  1763. case 'underline'//下划线
  1764. io[i].ofunderline=f_new
  1765. end choose
  1766. wf_object(i,1)
  1767. next
  1768. dw1.setredraw(true)
  1769. return
  1770. end subroutine
  1771. public function string wf_idscreate ();string ls_error
  1772. //event ue_dw2_sort()
  1773. //wf_write()
  1774. //ids.create(is_dw,ls_error)
  1775. //ids.settransobject(it_report)
  1776. return ls_error
  1777. end function
  1778. public subroutine wf_unit ();string ls[],sx[],ls1,ls2,ls3,ls4,ls5,ls6//暂时先用以下方法处理,如果发现有问题,最好不要采用先MODIFY的方法
  1779. long j,k,m,n,o,p,q,ll
  1780. q=long(ids.describe('datawindow.units'))//0=Pb单位,1=象素单位,3=0.1毫米
  1781. if q=1 then return
  1782. f_atab(ls[],ids.describe('datawindow.bands')+'~t')
  1783. p=upperbound(ls[])
  1784. f_atab(ls[],ids.describe('datawindow.bands')+'~t'+ids.describe('datawindow.objects')+'~tdatawindow~t')
  1785. k=upperbound(ls[])
  1786. for j=1 to k
  1787. is_type=ids.describe(ls[j]+'.type')
  1788. m=0
  1789. choose case is_type
  1790. case 'line'
  1791. m=5
  1792. sx[1]='x1'
  1793. sx[2]='y1'
  1794. sx[3]='x2'
  1795. sx[4]='y2'
  1796. sx[5]='pen.width'
  1797. case 'rectangle','ellipse','roundrectangle'
  1798. m=5
  1799. sx[1]='x'
  1800. sx[2]='y'
  1801. sx[3]='width'
  1802. sx[4]='height'
  1803. sx[5]='pen.width'
  1804. case 'text','column','compute','bitmap','graph','tableblob','report','button','groupbox'
  1805. m=4
  1806. sx[1]='x'
  1807. sx[2]='y'
  1808. sx[3]='width'
  1809. sx[4]='height'
  1810. case else
  1811. if j<=p then//'band'
  1812. m=1
  1813. sx[1]='height'
  1814. elseif j=k then//'datawindow'
  1815. m=4
  1816. sx[1]='print.margin.left'
  1817. sx[2]='print.margin.right'
  1818. sx[3]='print.margin.top'
  1819. sx[4]='print.margin.bottom'
  1820. if ids.describe('datawindow.processing')='2' then
  1821. m=10
  1822. sx[5]='label.width'
  1823. sx[6]='label.height'
  1824. sx[7]='label.rows.spacing'
  1825. sx[8]='label.columns.spacing'
  1826. sx[9]='label.ellipse_height'
  1827. sx[10]='label.ellipse_width'
  1828. end if
  1829. else
  1830. continue
  1831. end if
  1832. end choose
  1833. for n=1 to m
  1834. if j<=p then//'band'
  1835. ls5='datawindow.'+ls[j]+'.'+sx[n]
  1836. else
  1837. ls5=ls[j]+'.'+sx[n]
  1838. end if
  1839. ls1=ids.describe(ls5)
  1840. o=pos(ls1,'~t')
  1841. if o>0 then
  1842. ls2=left(ls1,o -1)
  1843. ls3=mid(ls1,o+1)
  1844. else
  1845. ls2=ls1
  1846. ls3=''
  1847. end if
  1848. if ls2='?' then continue
  1849. choose case q
  1850. case 0//PB
  1851. if pos(',x,x1,x2,width,print.margin.left,print.margin.right,',','+sx[n]+',')>0 then
  1852. ll=UnitsToPixels(long(ls2),xUnitsToPixels!)
  1853. else
  1854. ll=UnitsToPixels(long(ls2),yUnitsToPixels!)
  1855. end if
  1856. case 2//1/1000英寸
  1857. ll=int(long(ls2)*2.54/(ln_bl*10))
  1858. case 3//0.1毫米
  1859. ll=int(long(ls2)/(ln_bl*10))
  1860. end choose
  1861. ls4=string(ll,'0')
  1862. if ls3>'' then ls4=ls4+'~t'+ls3
  1863. if j<=p then//'band'
  1864. if ls[j]='background' then
  1865. continue
  1866. else
  1867. ls5='datawindow.'+ls[j]+'.'+sx[n]+"="+ls4
  1868. end if
  1869. else
  1870. ls5=ls[j]+'.'+sx[n]+"='"+ls4+"'"
  1871. end if
  1872. ls6=ls6+' '+ls5
  1873. // ls1=ids.modify(ls5)//对于crosstab,单个column就modify会出现没有修改到的情况,所有对象一起modify反而没有问题
  1874. next
  1875. next
  1876. ids.modify(ls6)//对于crosstab,单个column就modify会出现没有修改到的情况,所有对象一起modify反而没有问题
  1877. is_dw=ids.describe('DataWindow.Syntax')
  1878. is_dw=f_replace(is_dw,'units='+string(q),'units=1')
  1879. ids.create(is_dw)
  1880. ids.settransobject(it_report)
  1881. end subroutine
  1882. public function integer wf_afind ();int li
  1883. for li=1 to iis
  1884. if io[li].oname=iso then
  1885. return li
  1886. end if
  1887. next
  1888. return 0
  1889. end function
  1890. public function string wf_object (integer j, integer k);iso=io[j].oname
  1891. string ls1,ls2
  1892. choose case io[j].otype
  1893. case 'line'
  1894. if k=0 then
  1895. ls2="x1= '"+io[j].ox1+"' y1='"+io[j].oy1+"' x2='" +io[j].ox2+ "' y2='"+io[j].oy2+"'"
  1896. ls2="create line(band=detail "+ls2+" name="+io[j].oname+" pen.style='"+io[j].oborder+"' pen.width='"+io[j].otext+"' pen.color='"+io[j].ocolor+"' background.mode='2' background.color='"+io[j].obcolor+"')"
  1897. else
  1898. ls2=iso+".x1= '"+io[j].ox1+"' "+iso+".y1='"+io[j].oy1+"' "+iso+".x2='" +io[j].ox2+ "' "+iso+".y2='"+io[j].oy2+"' "
  1899. ls2=ls2+iso+".pen.style='"+io[j].oborder+"' "+iso+".pen.width='"+io[j].otext+"' "+iso+".background.color='"+io[j].obcolor+"'"
  1900. end if
  1901. ii_save=1
  1902. case 'text'
  1903. ls1=f_replace(io[j].otext,"'","~~~'")
  1904. if k=0 then
  1905. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' font.face='"+io[j].ofname+"' font.height='"+io[j].ofsize+"' "+wf_ssx('',"font.weight","'",io[j].ofweight)+wf_ssx('',"font.italic","'",io[j].ofitalic)+wf_ssx('',"font.underline","'",io[j].ofunderline)+" alignment='"+io[j].oalignment+"'"
  1906. ls2="create text(band=detail "+ls2+" border='2' name="+io[j].oname+" color='"+io[j].ocolor+"' background.color='"+io[j].obcolor+"' background.mode='2')"//background.mode不要删除,否则obcolor='536870912'时间变黑
  1907. else
  1908. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".font.face='"+io[j].ofname+"' "+iso+".font.height='"+io[j].ofsize+"' "+wf_ssx(iso,"font.weight","'",io[j].ofweight)+wf_ssx(iso,"font.italic","'",io[j].ofitalic)+wf_ssx(iso,"font.underline","'",io[j].ofunderline)+iso+".alignment='"+io[j].oalignment+"' "
  1909. ls2=ls2+iso+".background.color='"+io[j].obcolor+"'"
  1910. end if
  1911. ii_save=1
  1912. case 'groupbox'//类似text,比text少alignment,多border属性
  1913. ls1=f_replace(io[j].otext,"'","~~~'")
  1914. if k=0 then
  1915. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' font.face='"+io[j].ofname+"' font.height='"+io[j].ofsize+"' "+wf_ssx('',"font.weight","'",io[j].ofweight)+wf_ssx('',"font.italic","'",io[j].ofitalic)+wf_ssx('',"font.underline","'",io[j].ofunderline)//+" alignment='"+io[j].oalignment+"'"
  1916. ls2="create groupbox(band=detail "+ls2+" border='"+io[j].oborder+"' name="+io[j].oname+" color='"+io[j].ocolor+"' background.color='"+io[j].obcolor+"' background.mode='2')"//background.mode不要删除,否则obcolor='536870912'时间变黑
  1917. else
  1918. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".font.face='"+io[j].ofname+"' "+iso+".font.height='"+io[j].ofsize+"' "+wf_ssx(iso,"font.weight","'",io[j].ofweight)+wf_ssx(iso,"font.italic","'",io[j].ofitalic)+wf_ssx(iso,"font.underline","'",io[j].ofunderline)+iso+".border='"+io[j].oborder+"' "
  1919. ls2=ls2+iso+".background.color='"+io[j].obcolor+"'"
  1920. end if
  1921. ii_save=1
  1922. case 'column'
  1923. if io[j].otext='' then io[j].otext=io[j].oname
  1924. choose case io[j].oexpression
  1925. case 'edit','editmask'
  1926. ls1=f_replace(io[j].otext,"'","~~~'")
  1927. case 'dddw','ddlb'
  1928. ls1=f_replace(io[j].otext,"'","~~~'")+' ▼'
  1929. case 'checkbox'
  1930. ls1=f_rsx(io[j].others,'checkbox.text')
  1931. if f_rsx(io[j].others,'checkbox.lefttext')='yes' then
  1932. ls1=ls1+"口"
  1933. else
  1934. ls1="口"+ls1
  1935. end if
  1936. case 'radiobuttons'
  1937. int li
  1938. s[4]=f_rsx(io[j].others,'id')
  1939. s[3]=dw3.getitemstring(long(s[4]),'cvalues')
  1940. if s[3]>'' then
  1941. if right(s[3],1)<>'/' then s[3]=s[3]+'/'
  1942. do while true
  1943. li=pos(s[3],char(9))
  1944. if li=0 then exit
  1945. s[1]=left(s[3],li -1)
  1946. s[3]=mid(s[3],li+1)
  1947. li=pos(s[3],'/')
  1948. s[3]=mid(s[3],li+1)
  1949. if f_rsx(io[j].others,'radiobuttons.lefttext')='yes' then
  1950. ls1=ls1+' '+s[1]+' o'
  1951. else
  1952. ls1=ls1+' o '+s[1]
  1953. end if
  1954. loop
  1955. end if
  1956. end choose
  1957. if id[1].ofweight>'1' then//N-UP
  1958. ls2=f_rsx(io[j].others,'row_in_detail')
  1959. if ls2>'' then ls1=ls1+'_'+ls2
  1960. end if
  1961. if istr_rpt.text='0' then ls1=f_replace(ls1,io[j].otext,io[j].oname)//字段名不进行翻译
  1962. if k=0 then
  1963. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' font.face='"+io[j].ofname+"' font.height='"+io[j].ofsize+"' "+wf_ssx('',"font.weight","'",io[j].ofweight)+wf_ssx('',"font.italic","'",io[j].ofitalic)+wf_ssx('',"font.underline","'",io[j].ofunderline)+" alignment='"+io[j].oalignment+"'"
  1964. ls2="create text(band=detail "+ls2+" border='5' name="+io[j].oname+" color='"+io[j].ocolor+"' background.color='"+io[j].obcolor+"' background.mode='2')"//background.mode不要删除,否则obcolor='536870912'时间变黑
  1965. else
  1966. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".font.face='"+io[j].ofname+"' "+iso+".font.height='"+io[j].ofsize+"' "+wf_ssx(iso,"font.weight","'",io[j].ofweight)+wf_ssx(iso,"font.italic","'",io[j].ofitalic)+wf_ssx(iso,"font.underline","'",io[j].ofunderline)+iso+".alignment='"+io[j].oalignment+"' "
  1967. ls2=ls2+iso+".background.color='"+io[j].obcolor+"'"
  1968. end if
  1969. ii_save=1
  1970. case 'compute'
  1971. if io[j].otext='' then io[j].otext=io[j].oexpression
  1972. ls1=f_replace(io[j].otext,"'","~~~'")
  1973. if istr_rpt.text='0' then ls1=f_replace(ls1,io[j].otext,io[j].oexpression)//字段名不进行翻译
  1974. if k=0 then
  1975. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' font.face='"+io[j].ofname+"' font.height='"+io[j].ofsize+"' "+wf_ssx('',"font.weight","'",io[j].ofweight)+wf_ssx('',"font.italic","'",io[j].ofitalic)+wf_ssx('',"font.underline","'",io[j].ofunderline)+" alignment='"+io[j].oalignment+"'"
  1976. ls2="create text(band=detail "+ls2+" border='5' name="+io[j].oname+" color='"+io[j].ocolor+"' background.color='"+io[j].obcolor+"' background.mode='2')"//background.mode不要删除,否则obcolor='536870912'时间变黑
  1977. else
  1978. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".font.face='"+io[j].ofname+"' "+iso+".font.height='"+io[j].ofsize+"' "+wf_ssx(iso,"font.weight","'",io[j].ofweight)+wf_ssx(iso,"font.italic","'",io[j].ofitalic)+wf_ssx(iso,"font.underline","'",io[j].ofunderline)+iso+".alignment='"+io[j].oalignment+"' "
  1979. ls2=ls2+iso+".background.color='"+io[j].obcolor+"'"
  1980. end if
  1981. ii_save=1
  1982. case 'band'
  1983. ls1=f_replace(io[j].otext,"'","~~~'")
  1984. if pos(io[j].oname,'band_g_h_')=1 then
  1985. ls1="▲组标题区"+mid(io[j].oname,10)+': '+ls1
  1986. elseif pos(io[j].oname,'band_g_b_')=1 then
  1987. ls1="▲组尾区"+mid(io[j].oname,10)+': '+ls1
  1988. end if
  1989. if istr_rpt.text='0' and pos(io[j].oname,'band_g_')=1 then ls1=f_replace(ls1,io[j].otext,io[j].ofsize)//字段名不进行翻译
  1990. if k=0 then
  1991. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+string(long(io[j].oy1)+1)+"' width='"+string(ii_x_max)+"' height='12' font.face='宋体' font.height='12'"
  1992. ls2="create text(band=detail "+ls2+" border='2' color='0' name="+io[j].oname+" background.color='80269524' background.mode='2')"
  1993. else
  1994. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+string(long(io[j].oy1)+1)+"' "
  1995. end if
  1996. ii_save=1
  1997. case 'report','tableblob'
  1998. ls1=f_replace(io[j].otext,"'","~~~'")
  1999. if k=0 then
  2000. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' font.face='宋体' font.height='12'"
  2001. ls2="create text(band=detail "+ls2+" border='2' color='0' name="+io[j].oname+" background.color='16777215' background.mode='2')"
  2002. else
  2003. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "
  2004. end if
  2005. ii_save=1
  2006. case 'button'
  2007. ls1=f_replace(io[j].otext,"'","~~~'")
  2008. if k=0 then
  2009. ls2="text='"+ls1+"' x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' font.face='"+io[j].ofname+"' font.height='"+io[j].ofsize+"' "+wf_ssx('',"font.weight","'",io[j].ofweight)+wf_ssx('',"font.italic","'",io[j].ofitalic)+wf_ssx('',"font.underline","'",io[j].ofunderline)+" alignment='2'"
  2010. ls2="create text(band=detail "+ls2+" border='6' name="+io[j].oname+" color='"+io[j].ocolor+"' background.color='"+io[j].obcolor+"' background.mode='2')"//background.mode不要删除,否则obcolor='536870912'时间变黑
  2011. else
  2012. ls2=iso+".text='"+ls1+"' "+iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".font.face='"+io[j].ofname+"' "+iso+".font.height='"+io[j].ofsize+"' "+wf_ssx(iso,"font.weight","'",io[j].ofweight)+wf_ssx(iso,"font.italic","'",io[j].ofitalic)+wf_ssx(iso,"font.underline","'",io[j].ofunderline)
  2013. ls2=ls2+iso+".background.color='"+io[j].obcolor+"'"
  2014. end if
  2015. ii_save=1
  2016. //在PB6.5下,create button会跟dw1.event other有冲突,但在PB8.02下则不会出现非法出错.
  2017. case 'graph'
  2018. if k=0 then
  2019. ls2="x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"'"
  2020. ls2="create graph(band=detail graphtype='"+io[j].ofname+"' "+ls2+" name="+io[j].oname+" border='"+io[j].oborder+"' perspective='2' rotation='-20' color='0' backcolor='16777215' shadecolor='8355711' range=0 overlappercent='0' spacing='100' elevation='20' depth='100' category='zkl0' values='count(zkl0 for graph)' title='"+io[j].otext+"' category.label='"+io[j].ofweight+"' values.label='"+io[j].ofunderline+"' title.dispattr.alignment='2' title.dispattr.font.weight='700' series.labeldispattr.alignment='2' category.labeldispattr.alignment='2' values.labeldispattr.alignment='2' values.labeldispattr.font.escapement='900' values.labeldispattr.font.height='12' title.dispattr.backcolor='553648127' legend.dispattr.backcolor='536870912' series.dispattr.backcolor='536870912' series.labeldispattr.backcolor='536870912' category.dispattr.backcolor='536870912' category.labeldispattr.backcolor='536870912' values.dispattr.backcolor='536870912' values.labeldispattr.backcolor='536870912')"
  2021. // ls2=ls2+" title.dispattr.backcolor='553648127' title.dispattr.autosize='1' title.dispattr.font.charset='0' title.dispattr.font.escapement='0' title.dispattr.font.face='Arial' title.dispattr.font.family='2' title.dispattr.font.height='0' title.dispattr.font.italic='0' title.dispattr.font.orientation='0' title.dispattr.font.pitch='2' title.dispattr.font.strikethrough='0' title.dispattr.font.underline='0' title.dispattr.format='[General]' title.dispattr.textcolor='0' title.dispattr.displayexpression='title' legend='4' legend.dispattr.backcolor='536870912' legend.dispattr.alignment='0' legend.dispattr.autosize='1' legend.dispattr.font.charset='0' legend.dispattr.font.escapement='0' legend.dispattr.font.face='Arial' legend.dispattr.font.family='2' legend.dispattr.font.height='0' legend.dispattr.font.italic='0' legend.dispattr.font.orientation='0' legend.dispattr.font.pitch='2' legend.dispattr.font.strikethrough='0' legend.dispattr.font.underline='0' legend.dispattr.font.weight='400' legend.dispattr.format='[General]' legend.dispattr.textcolor='0' legend.dispattr.displayexpression='series' series.autoscale='1' series.displayeverynlabels='0' series.droplines='0' series.frame='1' series.label='Series' series.majordivisions='0' series.majorgridline='0' series.majortic='3' series.maximumvalue='0' series.minimumvalue='0' series.minordivisions='0' series.minorgridline='0' series.minortic='1' series.originline='0' series.primaryline='1' series.roundto='0' series.roundtounit='0' series.scaletype='1' series.scalevalue='1' series.secondaryline='0' series.shadebackedge='0' series.dispattr.backcolor='536870912' series.dispattr.alignment='0' series.dispattr.autosize='1' series.dispattr.font.charset='0' series.dispattr.font.escapement='0' series.dispattr.font.face='Arial' series.dispattr.font.family='2' series.dispattr.font.height='0' series.dispattr.font.italic='0' series.dispattr.font.orientation='0' series.dispattr.font.pitch='2' series.dispattr.font.strikethrough='0' series.dispattr.font.underline='0' series.dispattr.font.weight='400' series.dispattr.format='[General]' series.dispattr.textcolor='0' series.dispattr.displayexpression='series' series.labeldispattr.backcolor='536870912' series.labeldispattr.autosize='0' series.labeldispattr.font.charset='0' series.labeldispattr.font.escapement='0' series.labeldispattr.font.face='Arial' series.labeldispattr.font.family='2' series.labeldispattr.font.height='-8' series.labeldispattr.font.italic='0' series.labeldispattr.font.orientation='0' series.labeldispattr.font.pitch='2' series.labeldispattr.font.strikethrough='0' series.labeldispattr.font.underline='0' series.labeldispattr.font.weight='1000' series.labeldispattr.format='[General]' series.labeldispattr.textcolor='0' series.labeldispattr.displayexpression='seriesaxislabel' series.sort='1' category.autoscale='1' category.displayeverynlabels='0' category.droplines='0' category.frame='1' category.majordivisions='0' category.majorgridline='0' category.majortic='3' category.maximumvalue='0' category.minimumvalue='0' category.minordivisions='0' category.minorgridline='0' category.minortic='1' category.originline='0' category.primaryline='1' category.roundto='0' category.roundtounit='0' category.scaletype='1' category.scalevalue='1' category.secondaryline='0' category.shadebackedge='1' category.dispattr.backcolor='536870912' category.dispattr.alignment='2' category.dispattr.autosize='1' category.dispattr.font.charset='0' category.dispattr.font.escapement='0' category.dispattr.font.face='Arial' category.dispattr.font.family='2' category.dispattr.font.height='0' category.dispattr.font.italic='0' category.dispattr.font.orientation='0' category.dispattr.font.pitch='2' category.dispattr.font.strikethrough='0' category.dispattr.font.underline='0' category.dispattr.font.weight='400' category.dispattr.format='[General]' category.dispattr.textcolor='0' category.dispattr.displayexpression='category' category.labeldispattr.backcolor='536870912' category.labeldispattr.autosize='0' category.labeldispattr.font.charset='0' category.labeldispattr.font.escapement='0' category.labeldispattr.font.face='Arial' category.labeldispattr.font.family='2' category.labeldispattr.font.height='-8' category.labeldispattr.font.italic='0' category.labeldispattr.font.orientation='0' category.labeldispattr.font.pitch='2' category.labeldispattr.font.strikethrough='0' category.labeldispattr.font.underline='0' category.labeldispattr.font.weight='1000' category.labeldispattr.format='[General]' category.labeldispattr.textcolor='0' category.labeldispattr.displayexpression='categoryaxislabel' category.sort='1' values.autoscale='1' values.displayeverynlabels='0' values.droplines='0' values.frame='1' values.majordivisions='0' values.majorgridline='0' values.majortic='3' values.maximumvalue='250' values.minimumvalue='0' values.minordivisions='0' values.minorgridline='0' values.minortic='1' values.originline='1' values.primaryline='1' values.roundto='0' values.roundtounit='0' values.scaletype='1' values.scalevalue='1' values.secondaryline='0' values.shadebackedge='0' values.dispattr.backcolor='536870912' values.dispattr.alignment='1' values.dispattr.autosize='1' values.dispattr.font.charset='0' values.dispattr.font.escapement='0' values.dispattr.font.face='Arial' values.dispattr.font.family='2' values.dispattr.font.height='0' values.dispattr.font.italic='0' values.dispattr.font.orientation='0' values.dispattr.font.pitch='2' values.dispattr.font.strikethrough='0' values.dispattr.font.underline='0' values.dispattr.font.weight='400' values.dispattr.format='[General]' values.dispattr.textcolor='0' values.dispattr.displayexpression='value' values.labeldispattr.backcolor='536870912' values.labeldispattr.font.charset='0' values.labeldispattr.font.face='Arial' values.labeldispattr.autosize='0' values.labeldispattr.font.family='2' values.labeldispattr.font.italic='0' values.labeldispattr.font.orientation='900' values.labeldispattr.font.pitch='2' values.labeldispattr.font.strikethrough='0' values.labeldispattr.font.underline='0' values.labeldispattr.font.weight='1000' values.labeldispattr.format='[General]' values.labeldispattr.textcolor='0' values.labeldispattr.displayexpression='valuesaxislabel'"
  2022. else
  2023. ls2=iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "
  2024. ls2=ls2+iso+".graphtype='"+io[j].ofname+"' "+iso+".title='"+io[j].otext+"' "+iso+".category.label='"+io[j].ofweight+"' "+iso+".values.label='"+io[j].ofunderline+"'"
  2025. end if
  2026. ii_save=1
  2027. case 'rectangle','ellipse'
  2028. if k=0 then
  2029. ls2="x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"'"
  2030. ls2="create "+io[j].otype+"(band=detail "+ls2+" name="+io[j].oname+" brush.hatch='6' brush.color='"+io[j].ofname+"' pen.style='"+io[j].oborder+"' pen.width='"+io[j].otext+"' pen.color='"+io[j].ocolor+"' background.mode='2' background.color='"+io[j].obcolor+"')"
  2031. else
  2032. ls2=iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".brush.color='"+io[j].ofname+"' "+iso+".pen.style='"+io[j].oborder+"' "+iso+".pen.width='"+io[j].otext+"' "+iso+".background.color='"+io[j].obcolor+"' "
  2033. end if
  2034. ii_save=1
  2035. case 'roundrectangle'//类似rectangle
  2036. if k=0 then
  2037. ls2="x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"'"
  2038. ls2="create roundrectangle(band=detail "+ls2+" name="+io[j].oname+" ellipseheight='9' ellipsewidth='10' brush.hatch='6' brush.color='"+io[j].ofname+"' pen.style='"+io[j].oborder+"' pen.width='"+io[j].otext+"' pen.color='"+io[j].ocolor+"' background.mode='2' background.color='"+io[j].obcolor+"')"
  2039. else
  2040. ls2=iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "+iso+".brush.color='"+io[j].ofname+"' "+iso+".pen.style='"+io[j].oborder+"' "+iso+".pen.width='"+io[j].otext+"' "+iso+".background.color='"+io[j].obcolor+"' "
  2041. end if
  2042. ii_save=1
  2043. case 'bitmap'//ok
  2044. if pos('background,foreground',io[j].oband)>0 then
  2045. is_temp=io[j].oband//底图很大时需要这样处理
  2046. else
  2047. is_temp='detail'
  2048. end if
  2049. if k=0 then
  2050. ls2="x='"+io[j].ox1+"' y='"+io[j].oy1+"' width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' height='"+string(long(io[j].oy2)-long(io[j].oy1))+"'"
  2051. ls2="create bitmap(band="+is_temp+" filename='"+io[j].otext+"' "+ls2+" name="+io[j].oname+" border='"+io[j].oborder+"')"
  2052. else
  2053. ls2=iso+".x='"+io[j].ox1+"' "+iso+".y='"+io[j].oy1+"' "+iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"' "
  2054. ls2=ls2+iso+".filename='"+io[j].otext+"' "
  2055. end if
  2056. ii_save=1
  2057. case 'sep1' //垂直分割
  2058. if k=0 then
  2059. ls2="x='"+io[j].ox1+"' y='-2' height='"+string(ii_y_max)+"' width='0'"
  2060. ls2="create rectangle(band=detail "+ls2+" name=sep1 brush.hatch='7' brush.color='0' pen.style='2' pen.width='1' pen.color='255' background.mode='2' background.color='0')"
  2061. else
  2062. ls2=iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"'"
  2063. end if
  2064. case 'temp' //没有对象的空地方
  2065. if k=0 then
  2066. ls2="x='"+io[j].ox1+"' y='"+io[j].oy1+"' height='0' width='0'"
  2067. ls2="create rectangle(band=detail "+ls2+" name=temp brush.hatch='7' brush.color='12632256' pen.style='0' pen.width='1' pen.color='255' background.mode='2' background.color='0')"
  2068. else
  2069. ls2=iso+".width='"+string(long(io[j].ox2)-long(io[j].ox1))+"' "+iso+".height='"+string(long(io[j].oy2)-long(io[j].oy1))+"'"
  2070. end if
  2071. case 'datawindow'
  2072. if k=0 then
  2073. ls2=''
  2074. else
  2075. ls2="datawindow.color="+io[j].oband
  2076. ii_save=1
  2077. end if
  2078. case else
  2079. ls2=''
  2080. end choose
  2081. dw1.modify(ls2)
  2082. return ls2
  2083. end function
  2084. public subroutine wf_adelete (integer j);int li,lj
  2085. if j=0 then return
  2086. dw1.modify('destroy '+io[j].oname)
  2087. li=min(iis+2,upperbound(io))
  2088. for lj=j to li -1
  2089. io[lj]=io[lj+1]
  2090. next
  2091. iis --
  2092. io[lj]=id[2]//清空最后一行
  2093. ii_save=1
  2094. end subroutine
  2095. public subroutine wf_asort (string fs);long j,k,t
  2096. robj loi[1]
  2097. k=iis
  2098. choose case fs
  2099. case 'y1'
  2100. do while k>0
  2101. k=k/2
  2102. For i=k To iis -1
  2103. For j=(i -k+1) To 1 Step -1
  2104. If long(io[j].oy1)<=long(io[j+k].oy1) Then Exit
  2105. loi[1]=io[j]
  2106. io[j]=io[j+k]
  2107. io[j+k]=loi[1]
  2108. j=j -k +1
  2109. next
  2110. next
  2111. loop
  2112. case 'x1'
  2113. do while k>0
  2114. k=k/2
  2115. For i=k To iis -1
  2116. For j=(i -k+1) To 1 Step -1
  2117. If long(io[j].ox1)<=long(io[j+k].ox1) Then Exit
  2118. loi[1]=io[j]
  2119. io[j]=io[j+k]
  2120. io[j+k]=loi[1]
  2121. j=j -k +1
  2122. next
  2123. next
  2124. loop
  2125. case 'select'
  2126. do while k>0
  2127. k=k/2
  2128. For i=k To iis -1
  2129. For j=(i -k+1) To 1 Step -1
  2130. If long(io[j].oselect)<=long(io[j+k].oselect) Then Exit
  2131. loi[1]=io[j]
  2132. io[j]=io[j+k]
  2133. io[j+k]=loi[1]
  2134. j=j -k +1
  2135. next
  2136. next
  2137. loop
  2138. case 'cc'
  2139. do while k>0
  2140. k=k/2
  2141. For i=k To iis -1
  2142. For j=(i -k+1) To 1 Step -1
  2143. If io[j].occ<=io[j+k].occ Then Exit
  2144. if io[j].otype='band' then continue
  2145. loi[1]=io[j]
  2146. io[j]=io[j+k]
  2147. io[j+k]=loi[1]
  2148. j=j -k +1
  2149. next
  2150. next
  2151. loop
  2152. end choose
  2153. end subroutine
  2154. public subroutine wf_band4 (integer h1, integer h2, integer h3, integer h4, integer f_label);long j,k,m,n
  2155. string ls[]
  2156. if f_label=1 then
  2157. f_atab(ls[],ids.describe('datawindow.bands')+'~t')
  2158. k=upperbound(ls[])
  2159. for j=1 to k
  2160. if pos(ls[j],'header.')+pos(ls[j],'trailer.')+pos(ls[j],'background')>0 then continue
  2161. iis++
  2162. i=iis
  2163. io[i].otype='band'
  2164. io[i].ox1='0'
  2165. io[i].oband=ls[j]
  2166. m=long(ids.Describe('DataWindow.'+io[i].oband+'.height'))
  2167. if n>0 then
  2168. m=m+n+14
  2169. else
  2170. m=m+1
  2171. end if
  2172. io[i].oy1=string(m)
  2173. n=m
  2174. choose case left(ls[j],6)
  2175. case 'header'
  2176. io[i].otext="▲页表头"+mid(ls[j],7)
  2177. io[i].oname='band1'+mid(ls[j],8,len(ls[j]) -8)
  2178. case 'detail'
  2179. io[i].otext="▲细节"
  2180. io[i].oname='band2'
  2181. io[i].oborder=ids.Describe('DataWindow.'+io[i].oband+'.height.autosize')
  2182. case 'summar'//'summary'
  2183. io[i].otext="▲总计区"
  2184. io[i].oname='band3'
  2185. case 'footer'
  2186. io[i].otext="▲页表尾"
  2187. io[i].oname='band4'
  2188. end choose
  2189. io[i].ox2=string(ii_x_max)
  2190. io[i].oy2=string(long(io[i].oy1)+12)
  2191. io[i].ocolor=ids.Describe('DataWindow.'+io[i].oband+'.color')
  2192. next
  2193. else
  2194. for j=1 to 4
  2195. iis++
  2196. i=iis
  2197. io[i].otype='band'
  2198. io[i].oname='band'+string(j)
  2199. io[i].ox1='0'
  2200. choose case j
  2201. case 1
  2202. io[i].oy1=string(h1)
  2203. io[i].otext="▲页表头"
  2204. io[i].oband='header'
  2205. case 2
  2206. io[i].oy1=string(long(io[i -1].oy1)+h2+14)
  2207. io[i].otext="▲细节"
  2208. io[i].oband='detail'
  2209. io[i].oborder='no'
  2210. case 3
  2211. io[i].oy1=string(long(io[i -1].oy1)+h3+14)
  2212. io[i].otext="▲总计区"
  2213. io[i].oband='summary'
  2214. case 4
  2215. io[i].oy1=string(long(io[i -1].oy1)+h4+14)
  2216. io[i].otext="▲页表尾"
  2217. io[i].oband='footer'
  2218. end choose
  2219. io[i].ox2=string(ii_x_max)
  2220. io[i].oy2=string(long(io[i].oy1)+12)
  2221. io[i].ocolor='536870912'
  2222. next
  2223. end if
  2224. end subroutine
  2225. public subroutine wf_insertgroup (integer i_h, integer i_b, string s_oexp, string s_o2exp, string s_newpage, string s_resetpagecount, integer f_label);ii_group++
  2226. if ii_group=1 then
  2227. iso='band1'
  2228. else
  2229. iso='band_g_h_'+string(ii_group - 1)
  2230. end if
  2231. iio=wf_afind()//找到iso
  2232. if iio=0 then//band11=herder[1],band12=herder[2]
  2233. for i=iis to 1 step -1
  2234. if io[i].otype='band' and pos(io[i].oname,'band1')=1 then
  2235. iio=i
  2236. exit
  2237. end if
  2238. next
  2239. end if
  2240. i=iio
  2241. wf_aftermove(i_h+14,0)//带区移动14
  2242. iis++
  2243. i=iis
  2244. io[i].otype='band'
  2245. io[i].oname='band_g_h_'+string(ii_group)
  2246. io[i].oband='header.'+string(ii_group)
  2247. io[i].ox1='0'
  2248. io[i].oy1=string(long(io[iio].oy1)+i_h+14)
  2249. io[i].ox2=string(ii_x_max)
  2250. io[i].oy2=string(long(io[i].oy1)+12)
  2251. if f_label=1 then
  2252. io[i].ocolor=ids.Describe("DataWindow.header."+String(ii_group)+".color")
  2253. else
  2254. io[i].ocolor='536870912'
  2255. end if
  2256. io[i].obcolor=s_newpage
  2257. io[i].ofname=s_resetpagecount
  2258. io[i].otext=s_oexp
  2259. io[i].ofsize=s_o2exp
  2260. if f_label=0 then
  2261. wf_object(i,0)
  2262. end if
  2263. iso='band2'
  2264. iio=wf_afind()//找到iso
  2265. i=iio
  2266. wf_aftermove(i_b+14,0)
  2267. iis++
  2268. i=iis
  2269. io[i].otype='band'
  2270. io[i].oname='band_g_b_'+string(ii_group)
  2271. io[i].oband='trailer.'+string(ii_group)
  2272. io[i].ox1='0'
  2273. io[i].oy1=string(long(io[iio].oy1)+i_b+14)
  2274. io[i].ox2=string(ii_x_max)
  2275. io[i].oy2=string(long(io[i].oy1)+12)
  2276. if f_label=1 then
  2277. io[i].ocolor=ids.Describe("DataWindow.trailer."+String(ii_group)+".color")
  2278. else
  2279. io[i].ocolor='536870912'
  2280. end if
  2281. io[i].obcolor=s_newpage
  2282. io[i].ofname=s_resetpagecount
  2283. io[i].otext=s_oexp
  2284. io[i].ofsize=s_o2exp
  2285. if f_label=0 then
  2286. wf_object(i,0)
  2287. end if
  2288. end subroutine
  2289. public subroutine wf_format (string s_type);int li_pos1,li_pos2
  2290. string ls_format
  2291. if pos('decimal,number,long,',left(s_type,7))>0 then
  2292. li_pos1=pos(s_type,'(')
  2293. li_pos2=pos(s_type,')')
  2294. if li_pos2 - li_pos1>1 then
  2295. ls_format='#,##0.'+left('000000000000',long(mid(s_type,li_pos1+1,li_pos2 - li_pos1 - 1)))
  2296. if right(ls_format,1)='.' then
  2297. ls_format=left(ls_format,len(ls_format) - 1)
  2298. end if
  2299. else
  2300. ls_format='#,##0'
  2301. end if
  2302. io[i].oalignment='1'
  2303. else
  2304. if pos(s_type,'date')=1 then
  2305. ls_format='yyyy/mm/dd'
  2306. elseif pos(s_type,'time')=1 then
  2307. ls_format='hh:mm:ss'
  2308. else
  2309. ls_format=''
  2310. end if
  2311. io[i].oalignment='0'
  2312. end if
  2313. io[i].others=io[i].others+'{format='+ls_format+'}'
  2314. end subroutine
  2315. public subroutine wf_title (integer i_x, integer i_y, string s_fname, integer i_fsize);if is_rname='' then return
  2316. iis++
  2317. i=iis
  2318. io[i].otype='text'
  2319. io[i].oname='text_tile'
  2320. io[i].otext=is_rname
  2321. io[i].ofname=s_fname
  2322. io[i].ofsize=string(i_fsize)
  2323. io[i].oalignment='2'
  2324. io[i].oborder='0'
  2325. io[i].ocolor='0'
  2326. io[i].obcolor='16777215'
  2327. if ii_bbgs=6 then//grid
  2328. io[i].oband='foreground'
  2329. io[i].ox1='0'
  2330. io[i].oy1='0'
  2331. io[i].ox2=string(max(ii_x -2,len(is_rname)*i_fsize/2))
  2332. io[i].oy2='38'
  2333. io[i].oborder='2'
  2334. else
  2335. io[i].ox1=string(i_x)
  2336. io[i].oy1=string(i_y)
  2337. io[i].ox2=string(long(io[i].ox1)+len(is_rname)*i_fsize/2)
  2338. io[i].oy2=string(long(io[i].oy1)+i_fsize)
  2339. io[i].oborder='0'
  2340. end if
  2341. end subroutine
  2342. public subroutine wf_page (integer i_x, integer i_y, string s_fname, integer i_fsize);iis++
  2343. i=iis
  2344. io[i].otype='compute'
  2345. io[i].oname='edit_page'
  2346. io[i].ox1=string(i_x)
  2347. io[i].oy1=string(i_y)
  2348. io[i].ox2=string(long(io[i].ox1)+38*i_fsize/2)
  2349. io[i].oy2=string(long(io[i].oy1)+i_fsize)
  2350. io[i].ofname=s_fname
  2351. io[i].ofsize=string(i_fsize)
  2352. io[i].oalignment='2'
  2353. io[i].oborder='0'
  2354. io[i].ocolor='0'
  2355. io[i].obcolor='16777215'
  2356. //io[i].otext='"第"+第几页()+"页/共"+总页数()+"页 "+转换成字符串(系统日期(),"yyyy/mm/dd hh:mm:ss")'
  2357. //io[i].oexpression='"第"+PAGE()+"页/共"+PAGECOUNT()+"页 "+STRING(TODAY(),"yyyy/mm/dd hh:mm:ss")'
  2358. io[i].otext="'第'+第几页()+'页/共'+总页数()+'页 '+转换成字符串(系统日期(),'yyyy/mm/dd hh:mm:ss')"
  2359. io[i].oexpression="'第'+PAGE()+'页/共'+PAGECOUNT()+'页 '+STRING(TODAY(),'yyyy/mm/dd hh:mm:ss')"
  2360. end subroutine
  2361. public subroutine wf_libexport ();
  2362. if wf_write() = 0 then return
  2363. i=iio
  2364. iio=iis+1
  2365. io[iio].otype='libexport'
  2366. openwithparm(w_rpt_edit,istr_rpt,THIS)
  2367. io[iio]=id[2]//清空最后一行
  2368. iio=i
  2369. end subroutine
  2370. public subroutine wf_libimport ();i=iio
  2371. iio=iis+1
  2372. io[iio].otype='libimport'
  2373. openwithparm(w_rpt_edit,istr_rpt,THIS)
  2374. if io[iio].oname>'' then
  2375. ids.dataobject=io[iio].oname
  2376. ids.settransobject(it_report)
  2377. io[iio]=id[2]//清空最后一行
  2378. wf_alldel()
  2379. wf_read('all')
  2380. wf_obj0()
  2381. dw1.modify("datawindow.color="+id[1].oband)
  2382. if isvalid(idwm) then
  2383. if f_myget(idwm,ii_rowm,'rdname')='' then
  2384. idwm.setitem(ii_rowm,'rdname',ids.dataobject)
  2385. end if
  2386. end if
  2387. else
  2388. io[iio]=id[2]//清空最后一行
  2389. iio=i
  2390. end if
  2391. end subroutine
  2392. public function string wf_ssx (string s1, string s2, string s3, string s4);string ls
  2393. if s4>'' then
  2394. if s1>'' then ls=s1+'.'
  2395. ls=ls+s2+'='+s3+s4+s3+' '
  2396. end if
  2397. return ls
  2398. end function
  2399. public function integer wf_crosstabc ();long j,k,m,n,o,ll,p
  2400. string lx1,lx2,ls_crossmode,ls_data,ls[]
  2401. datawindow ldw
  2402. ls_crossmode=w_rpt_edit.is_crossmode
  2403. if ls_crossmode<>'yes' then
  2404. ls_data=w_rpt_edit.is_data
  2405. f_atab(ls[],ls_data+'~t')
  2406. p=upperbound(ls[])//p>=1
  2407. else
  2408. p=1
  2409. end if
  2410. io[iio]=id[2]//清空最后一行
  2411. wf_alldel()
  2412. dw3.reset()
  2413. ii_rows=1+w_rpt_edit.dw2.rowcount()
  2414. if w_rpt_edit.dw4.rowcount()>1 then
  2415. ii_rows=ii_rows+1//header[]总数=columns+1+if(rows>1,1,0)
  2416. end if
  2417. for i=1 to ii_rows+3//带区总数=header[]总数+3
  2418. iis++
  2419. i=iis
  2420. io[i].otype='band'
  2421. io[i].ox1='0'
  2422. if i=1 then
  2423. m=24
  2424. else
  2425. m=18
  2426. end if
  2427. if n>0 then
  2428. m=m+n+14
  2429. else
  2430. m=m+1
  2431. end if
  2432. io[i].oy1=string(m)
  2433. n=m
  2434. if i<=ii_rows then
  2435. io[i].otext="▲页表头["+string(i)+']'
  2436. io[i].oname='band1'+string(i)
  2437. io[i].oband="header["+string(i)+']'
  2438. elseif i=ii_rows+1 then
  2439. io[i].otext="▲细节"
  2440. io[i].oname='band2'
  2441. io[i].oband="detail"
  2442. io[i].oborder='no'//ids.Describe('DataWindow.'+io[i].oband+'.height.autosize')
  2443. elseif i=ii_rows+2 then
  2444. io[i].otext="▲总计区"
  2445. io[i].oname='band3'
  2446. io[i].oband="summary"
  2447. elseif i=ii_rows+3 then
  2448. io[i].otext="▲页表尾"
  2449. io[i].oname='band4'
  2450. io[i].oband="footer"
  2451. end if
  2452. io[i].ox2=string(ii_x_max)
  2453. io[i].oy2=string(long(io[i].oy1)+12)
  2454. io[i].ocolor='536870912'
  2455. next
  2456. iis++
  2457. i=iis
  2458. io[i].otype='text'
  2459. io[i].oname='text_title'
  2460. io[i].oband='foreground'
  2461. io[i].ox1='0'
  2462. io[i].oy1='0'
  2463. io[i].ox2='780'
  2464. io[i].oy2='26'
  2465. io[i].otext=istr_rpt.rcname
  2466. io[i].oborder='0'
  2467. io[i].ocolor='0'
  2468. io[i].obcolor='16777215'
  2469. io[i].ofname='宋体'
  2470. io[i].ofsize='24'
  2471. io[i].oalignment='2'
  2472. m=2
  2473. //设置columns及上下标识,列数=rows field+values field
  2474. ldw=w_rpt_edit.dw3//rows field
  2475. n=ldw.rowcount()
  2476. ldw.RowsCopy(1,n,primary!,dw3,dw3.RowCount()+1,primary!)
  2477. for j=1 to n//添加column
  2478. ll=6*max(ldw.getitemnumber(j,'clen1'),ldw.getitemnumber(j,'clen2'))
  2479. iis++
  2480. i=iis
  2481. io[i].otype='column'
  2482. io[i].oname=ldw.getitemstring(j,'ckey')//=cname
  2483. io[i].oband='detail'
  2484. io[i].ox1=string(m)
  2485. io[i].oy1=string(long(io[ii_rows].oy1)+17)
  2486. io[i].ox2=string(m+ll)
  2487. io[i].oy2=string(long(io[i].oy1)+12)
  2488. io[i].otext=ldw.getitemstring(j,'cupdate')//=ctag
  2489. io[i].oborder='0'
  2490. io[i].ocolor='0'
  2491. io[i].obcolor='16777215'
  2492. io[i].ofname='宋体'
  2493. io[i].ofsize='12'
  2494. io[i].oalignment='0'
  2495. io[i].oexpression='edit'
  2496. o++
  2497. io[i].others='{id='+string(o)+'}'
  2498. wf_format(dw3.getitemstring(o,'ctype'))
  2499. iis++//添加column_t
  2500. i=iis
  2501. io[i].otype='text'
  2502. io[i].oname=ldw.getitemstring(j,'ckey')+'_t'//=cname
  2503. io[i].oband="header["+string(ii_rows)+']'
  2504. io[i].ox1=string(m)
  2505. io[i].oy1=string(long(io[ii_rows -1].oy1)+17)
  2506. io[i].ox2=string(m+ll)
  2507. io[i].oy2=string(long(io[i].oy1)+12)
  2508. io[i].otext=ldw.getitemstring(j,'cupdate')//=ctag
  2509. io[i].oborder='0'
  2510. io[i].ocolor='0'
  2511. io[i].obcolor='16777215'
  2512. io[i].ofname='宋体'
  2513. io[i].ofsize='12'
  2514. io[i].oalignment='2'
  2515. if j=1 then//添加'总计'
  2516. iis++
  2517. i=iis
  2518. io[i].otype='text'
  2519. io[i].oname=ldw.getitemstring(j,'ckey')+'_h'//=cname
  2520. io[i].oband="summary"
  2521. io[i].ox1=string(m)
  2522. io[i].oy1=string(long(io[ii_rows+1].oy1)+17)
  2523. io[i].ox2=string(m+ll)
  2524. io[i].oy2=string(long(io[i].oy1)+12)
  2525. io[i].otext='总计'//=ctag
  2526. io[i].oborder='0'
  2527. io[i].ocolor='0'
  2528. io[i].obcolor='16777215'
  2529. io[i].ofname='宋体'
  2530. io[i].ofsize='12'
  2531. io[i].oalignment='2'
  2532. end if
  2533. m=long(io[i].ox2)+2
  2534. next
  2535. //设置columns及上下标识,列数=rows field+values field
  2536. //ldw=w_rpt_edit.dw4//values field
  2537. //n=ldw.rowcount()
  2538. for k=1 to p
  2539. ldw=w_rpt_edit.dw4//values field
  2540. n=ldw.rowcount()
  2541. for j=1 to n
  2542. if k=1 then
  2543. ldw.setitem(j,'cname',ldw.getitemstring(j,'ckey'))
  2544. ldw.setitem(j,'ctag',ldw.getitemstring(j,'cupdate'))
  2545. else
  2546. ldw.setitem(j,'cname',ldw.getitemstring(j,'ckey')+'_'+string(k -1))
  2547. ldw.setitem(j,'ctag',ldw.getitemstring(j,'cupdate')+'_'+string(k -1))
  2548. end if
  2549. ldw.setitem(j,'cdbname',ldw.getitemstring(j,'cname'))
  2550. next
  2551. ldw.RowsCopy(1,n,primary!,dw3,dw3.RowCount()+1,primary!)
  2552. for j=1 to n//添加column
  2553. ll=6*12
  2554. iis++
  2555. i=iis
  2556. io[i].otype='column'
  2557. io[i].oname=ldw.getitemstring(j,'cname')
  2558. io[i].oband='detail'
  2559. io[i].ox1=string(m)
  2560. io[i].oy1=string(long(io[ii_rows].oy1)+17)
  2561. io[i].ox2=string(m+ll)
  2562. io[i].oy2=string(long(io[i].oy1)+12)
  2563. io[i].otext=ldw.getitemstring(j,'ctag')
  2564. io[i].oborder='0'
  2565. io[i].ocolor='0'
  2566. io[i].obcolor='16777215'
  2567. io[i].ofname='宋体'
  2568. io[i].ofsize='12'
  2569. io[i].oalignment='1'
  2570. io[i].oexpression='edit'
  2571. o++
  2572. io[i].others='{id='+string(o)+'}'
  2573. dw3.setitem(o,'ctype','number')
  2574. wf_format('number')
  2575. if n>1 then//添加values_t
  2576. iis++
  2577. i=iis
  2578. io[i].otype='text'
  2579. io[i].oname=ldw.getitemstring(j,'cname')+'_t'
  2580. io[i].oband="header["+string(ii_rows)+']'
  2581. io[i].ox1=string(m)
  2582. io[i].oy1=string(long(io[ii_rows -1].oy1)+17)
  2583. io[i].ox2=string(m+ll)
  2584. io[i].oy2=string(long(io[i].oy1)+12)
  2585. io[i].otext=ldw.getitemstring(j,'ctag')
  2586. io[i].oborder='0'
  2587. io[i].ocolor='0'
  2588. io[i].obcolor='16777215'
  2589. io[i].ofname='宋体'
  2590. io[i].ofsize='12'
  2591. io[i].oalignment='2'
  2592. end if
  2593. iis++//添加sum(values)
  2594. i=iis
  2595. io[i].otype='compute'
  2596. io[i].oname=ldw.getitemstring(j,'cname')+'_s'
  2597. io[i].oband="summary"
  2598. io[i].ox1=string(m)
  2599. io[i].oy1=string(long(io[ii_rows+1].oy1)+17)
  2600. io[i].ox2=string(m+ll)
  2601. io[i].oy2=string(long(io[i].oy1)+12)
  2602. io[i].otext='求和('+ldw.getitemstring(j,'ctag')+')'
  2603. io[i].oborder='0'
  2604. io[i].ocolor='0'
  2605. io[i].obcolor='16777215'
  2606. io[i].ofname='宋体'
  2607. io[i].ofsize='12'
  2608. io[i].oalignment='1'
  2609. io[i].oexpression='sum('+ldw.getitemstring(j,'cname')+')'
  2610. wf_format('number')
  2611. m=long(io[i].ox2)+2
  2612. if j=1 then lx1=io[i].ox1
  2613. if j=n then lx2=io[i].ox2
  2614. next
  2615. ldw=w_rpt_edit.dw2//columns
  2616. n=ldw.rowcount()
  2617. for j=1 to n//添加@column
  2618. iis++
  2619. i=iis
  2620. io[i].otype='text'
  2621. io[i].oname=ldw.getitemstring(j,'cname')+'_m'+string(k)
  2622. io[i].oband="header["+string(j+1)+']'
  2623. io[i].ox1=lx1
  2624. io[i].oy1=string(long(io[j].oy1)+17)
  2625. io[i].ox2=lx2
  2626. io[i].oy2=string(long(io[i].oy1)+12)
  2627. if ls_crossmode='yes' then
  2628. io[i].otext='@'+ldw.getitemstring(j,'cname')
  2629. else
  2630. io[i].otext=ls[k]
  2631. end if
  2632. io[i].oborder='0'
  2633. io[i].ocolor='0'
  2634. io[i].obcolor='16777215'
  2635. io[i].ofname='宋体'
  2636. io[i].ofsize='12'
  2637. io[i].oalignment='2'
  2638. next
  2639. next
  2640. m=long(lx2)+2//设置合计
  2641. ldw=w_rpt_edit.dw4//values
  2642. n=ldw.rowcount()
  2643. for j=1 to n//添加column
  2644. ll=6*12
  2645. iis++
  2646. i=iis
  2647. io[i].otype='compute'
  2648. io[i].oname=ldw.getitemstring(j,'ckey')+'_c'//=cname
  2649. io[i].oband='detail'
  2650. io[i].ox1=string(m)
  2651. io[i].oy1=string(long(io[ii_rows].oy1)+17)
  2652. io[i].ox2=string(m+ll)
  2653. io[i].oy2=string(long(io[i].oy1)+12)
  2654. io[i].oborder='0'
  2655. io[i].ocolor='0'
  2656. io[i].obcolor='16777215'
  2657. io[i].ofname='宋体'
  2658. io[i].ofsize='12'
  2659. io[i].oalignment='1'
  2660. io[i].oexpression='crosstabsum('+string(j)+')'
  2661. io[i].otext=io[i].oexpression
  2662. wf_format('number')
  2663. iis++
  2664. i=iis
  2665. io[i].otype='compute'
  2666. io[i].oname=ldw.getitemstring(j,'ckey')+'_cs'//=cname
  2667. io[i].oband='summary'
  2668. io[i].ox1=string(m)
  2669. io[i].oy1=string(long(io[ii_rows+1].oy1)+17)
  2670. io[i].ox2=string(m+ll)
  2671. io[i].oy2=string(long(io[i].oy1)+12)
  2672. io[i].oborder='0'
  2673. io[i].ocolor='0'
  2674. io[i].obcolor='16777215'
  2675. io[i].ofname='宋体'
  2676. io[i].ofsize='12'
  2677. io[i].oalignment='1'
  2678. io[i].oexpression='sum('+ldw.getitemstring(j,'ckey')+'_c)'
  2679. io[i].otext='求和('+ldw.getitemstring(j,'ckey')+'_c)'
  2680. iis++
  2681. i=iis
  2682. io[i].otype='text'
  2683. io[i].oname=ldw.getitemstring(j,'ckey')+'_ct'//=cname
  2684. io[i].oband='header[2]'
  2685. io[i].ox1=string(m)
  2686. io[i].oy1=string(long(io[1].oy1)+17)
  2687. io[i].ox2=string(m+ll)
  2688. io[i].oy2=string(long(io[i].oy1)+12)
  2689. io[i].oborder='0'
  2690. io[i].ocolor='0'
  2691. io[i].obcolor='16777215'
  2692. io[i].ofname='宋体'
  2693. io[i].ofsize='12'
  2694. io[i].oalignment='2'
  2695. io[i].otext=ldw.getitemstring(j,'cupdate')+'合计'
  2696. m=long(io[i].ox2)+2
  2697. next
  2698. k=dw3.rowcount()
  2699. for j=1 to k
  2700. // dw3.setitem(j,'cname',dw3.getitemstring(j,'ckey'))
  2701. // dw3.setitem(j,'ctag',dw3.getitemstring(j,'cupdate'))
  2702. dw3.setitem(j,'ckey','')
  2703. dw3.setitem(j,'cupdate','')
  2704. next
  2705. for i=1 to iis
  2706. wf_object(i,0)//根据对象不同分别生成Modify语句并执行
  2707. next
  2708. iio=iis+1//最后把iio设回iis+1
  2709. return 0
  2710. end function
  2711. public subroutine wf_dwinit ();id[1].otype='datawindow'
  2712. id[1].oband='16777215'//color
  2713. id[1].ox1='0'//processing数据窗口类型
  2714. id[1].ofweight='1'//rows_per_detail
  2715. id[1].ofitalic='1'//units
  2716. end subroutine
  2717. public subroutine wf_obj0 ();dw1.setredraw(false)
  2718. for i=1 to iis
  2719. wf_object(i,0)//根据对象不同分别生成Modify语句并执行
  2720. next
  2721. dw1.setredraw(true)
  2722. end subroutine
  2723. public function string wf_rowindetail (string s1, string s2);string ls[],lc
  2724. long l1,l2,l3,j
  2725. ls[1]=mid(s1,pos(s1,'band=') -10)
  2726. l1=pos(ls[1],'name='+s2)
  2727. if l1>0 then
  2728. l2=pos(ls[1],'~n',l1)//后一个换行符
  2729. for j=l1 to 1 step -1
  2730. if mid(ls[1],j,1)='~n' then//前一个换行符
  2731. l3=j
  2732. exit
  2733. end if
  2734. next
  2735. ls[2]=mid(ls[1],l3,l2 -l3)
  2736. l2=pos(ls[2],'row_in_detail=')
  2737. if l2>0 then
  2738. l3=pos(ls[2],' ',l2+14)
  2739. lc=trim(mid(ls[2],l2+14,l3 -l2 -14))
  2740. end if
  2741. end if
  2742. return lc
  2743. end function
  2744. public subroutine wf_aftermove (integer y1_add, integer ff);int li,ly1
  2745. ly1=long(io[iio].oy1)
  2746. for li=1 to iis
  2747. if long(io[li].oy1)<ly1 or (li=iio and ff=0) then continue
  2748. io[li].oy1=string(long(io[li].oy1)+y1_add)
  2749. io[li].oy2=string(long(io[li].oy2)+y1_add)
  2750. wf_object(li,1)
  2751. next
  2752. end subroutine
  2753. public function string wf_mysx (string fsx);string ls
  2754. ls=ids.describe(fsx)
  2755. //if left(ls,1)='"' then ls=mid(ls,2,len(ls)-2)
  2756. //ls=f_replace(ls,'~~~"','"')
  2757. if pos('!?',ls)>0 then ls=''
  2758. return ls
  2759. end function
  2760. public subroutine wf_wdata ();String ls1,ls2,ls3,ls4,ls
  2761. Long l1,l2,l3,j
  2762. ls1 = istr_rpt.rdata
  2763. IF ls1 = '' THEN RETURN
  2764. l3 = dw3.RowCount()
  2765. IF l3 = 0 THEN RETURN
  2766. datastore lds
  2767. is_temp = f_rpt_sdw(dw3)
  2768. IF is_temp = '' THEN RETURN
  2769. lds = CREATE datastore
  2770. lds.Create(is_temp)
  2771. lds.ImportString(ls1)
  2772. ls1 = ''
  2773. l1 = lds.RowCount()
  2774. FOR i = 1 TO l1
  2775. FOR j = 1 TO l3
  2776. is_temp = Left(dw3.Object.ctype[j],5)
  2777. CHOOSE CASE is_temp
  2778. CASE 'char(','varch'
  2779. ls = lds.GetItemString(i,j)
  2780. IF IsNull(ls) THEN
  2781. ls1 = ls1+'null '
  2782. ELSE
  2783. ls = f_replace(ls,'~~','~~~~')
  2784. ls1 = ls1+'"'+f_replace(ls,'"','~~~"')+'",'
  2785. END IF
  2786. CASE 'date'
  2787. ls = String(lds.GetItemDate(i,j),'yyyy-mm-dd')
  2788. IF IsNull(ls) OR ls = '' THEN
  2789. ls1 = ls1+'null '
  2790. ELSE
  2791. ls1 = ls1+String(Date(ls),'yyyy-mm-dd')+','
  2792. END IF
  2793. CASE 'datet' //datetime
  2794. ls = String(lds.GetItemDateTime(i,j),'yyyy-mm-dd hh:mm:ss')
  2795. IF IsNull(ls) OR ls = '' THEN
  2796. ls1 = ls1+'null '
  2797. ELSE
  2798. l2 = Pos(ls,' ')
  2799. IF l2 > 0 THEN
  2800. ls3 = Left(ls,l2 -1)
  2801. ls4 = Mid(ls,l2+1)
  2802. ELSE
  2803. ls3 = ls
  2804. ls4 = ''
  2805. END IF
  2806. ls1 = ls1+String(DateTime(Date(ls3),Time(ls4)),'yyyy-mm-dd hh:mm:ss')+','
  2807. END IF
  2808. CASE 'time'
  2809. ls = String(lds.GetItemTime(i,j),'hh:mm:ss:ffff')
  2810. IF IsNull(ls) OR ls = '' THEN
  2811. ls1 = ls1+'null '
  2812. ELSE
  2813. ls1 = ls1+ls+','
  2814. END IF
  2815. CASE 'long','ulong','numbe','decim'
  2816. ls = String(lds.GetItemNumber(i,j))
  2817. IF IsNull(ls) THEN
  2818. ls1 = ls1+'null '
  2819. ELSE
  2820. ls1 = ls1+' '+ls+','
  2821. END IF
  2822. END CHOOSE
  2823. NEXT
  2824. ls1 = ls1+'~n'
  2825. NEXT
  2826. ls1 = 'data('+ls1+')~n'
  2827. l2 = Pos(is_dw,'band=')
  2828. IF l2 = 0 THEN RETURN
  2829. FOR l1 = l2 TO 1 STEP -1
  2830. ls2 = Mid(is_dw,l1,1)
  2831. IF ls2 = '~n' THEN
  2832. ls3 = Left(is_dw,l1)
  2833. ls4 = Mid(is_dw,l1)
  2834. is_dw = ls3+ls1+ls4
  2835. EXIT
  2836. END IF
  2837. NEXT
  2838. DESTROY lds
  2839. RETURN
  2840. end subroutine
  2841. public subroutine wf_alldel ();for i=iis to 1 step -1//循环删除所有选中对象
  2842. wf_adelete(i)
  2843. next
  2844. ii_group=0
  2845. end subroutine
  2846. public function long wf_occ (integer icc);long ll,lr
  2847. for ll=1 to iis
  2848. if ll=1 then
  2849. lr=io[ll].occ
  2850. else
  2851. if icc=1 then
  2852. lr=max(lr,io[ll].occ)
  2853. else
  2854. lr=min(lr,io[ll].occ)
  2855. end if
  2856. end if
  2857. next
  2858. return lr
  2859. end function
  2860. public subroutine wf_dwimport ();i=iio
  2861. iio=iis+1
  2862. io[iio].oname = istr_rpt.oname
  2863. io[iio].otype = istr_rpt.otype
  2864. if io[iio].oname>'' then
  2865. ids.dataobject=io[iio].oname
  2866. ids.settransobject(it_report)
  2867. io[iio]=id[2]//清空最后一行
  2868. wf_alldel()
  2869. wf_read('all')
  2870. wf_obj0()
  2871. dw1.modify("datawindow.color="+id[1].oband)
  2872. if isvalid(idwm) then
  2873. if f_myget(idwm,ii_rowm,'rdname')='' then
  2874. idwm.setitem(ii_rowm,'rdname',ids.dataobject)
  2875. end if
  2876. end if
  2877. else
  2878. io[iio]=id[2]//清空最后一行
  2879. iio=i
  2880. end if
  2881. end subroutine
  2882. public function integer wf_upload (string arg_dwsyn, ref string arg_msg);
  2883. Long rslt = 1 ,cnt = 0
  2884. String ls_pblname
  2885. Blob lb_dwsyn
  2886. IF ls_pblpath <> '' THEN
  2887. ls_pblname = Replace(ls_pblpath,1,Len(sys_cur_path),'')
  2888. END IF
  2889. IF ifreport THEN
  2890. UPDATE u_report_user
  2891. SET uploadtime = getdate()
  2892. Where dwname = :is_rname;
  2893. IF sqlca.SQLCode = 0 THEN
  2894. lb_dwsyn = Blob(arg_dwsyn,EncodingANSI!)
  2895. UPDATEBLOB u_report_user
  2896. Set filedata = :lb_dwsyn
  2897. Where dwname = :is_rname;
  2898. IF sqlca.SQLCode = -1 THEN
  2899. arg_msg = '上传报表语法信息失败' + sqlca.SQLErrText
  2900. rslt = 0
  2901. GOTO ext
  2902. END IF
  2903. ELSEIF sqlca.SQLCode = -1 THEN
  2904. arg_msg = '更新报表上传时间失败' + sqlca.SQLErrText
  2905. rslt = 0
  2906. GOTO ext
  2907. END IF
  2908. ELSE
  2909. UPDATE sys_autoudpb
  2910. SET buildtime = getdate(),
  2911. uploadtime = getdate(),
  2912. pblname = :ls_pblname,
  2913. comments = :ls_comments
  2914. Where Filename = :is_rname;
  2915. IF sqlca.SQLCode = 0 THEN
  2916. IF sqlca.SQLNRows = 0 THEN
  2917. INSERT INTO sys_autoudpb
  2918. ( filename,
  2919. buildtime,
  2920. uploadtime,
  2921. pblname,
  2922. comments)
  2923. VALUES ( :is_rname,
  2924. getdate(),
  2925. getdate(),
  2926. :ls_pblname,
  2927. :ls_comments) ;
  2928. IF sqlca.SQLCode <> 0 THEN
  2929. arg_msg = '插入数据窗口列表失败' + sqlca.SQLErrText
  2930. rslt = 0
  2931. GOTO ext
  2932. END IF
  2933. END IF
  2934. COMMIT;
  2935. lb_dwsyn = Blob(arg_dwsyn,EncodingANSI!)
  2936. UPDATEBLOB sys_autoudpb
  2937. Set filedata = :lb_dwsyn
  2938. Where Filename = :is_rname;
  2939. IF sqlca.SQLCode = -1 THEN
  2940. arg_msg = '上传数据窗口语法信息失败' + sqlca.SQLErrText
  2941. rslt = 0
  2942. GOTO ext
  2943. END IF
  2944. ELSEIF sqlca.SQLCode = -1 THEN
  2945. arg_msg = '更新数据窗口修改日期失败' + sqlca.SQLErrText
  2946. rslt = 0
  2947. GOTO ext
  2948. END IF
  2949. END IF
  2950. ext:
  2951. IF rslt = 0 THEN
  2952. ROLLBACK;
  2953. ELSE
  2954. COMMIT;
  2955. END IF
  2956. RETURN rslt
  2957. end function
  2958. public function integer wf_write ();long ll[9],j,li_cols,o,p,q,m,n
  2959. string ls_group[],ls_modify,ls_sql,ls_cols,ls_obj,ls_groups,ls_editstyle,ls_dw,ls_crosstab
  2960. string lscc[]//对象分层次用
  2961. int licc
  2962. SetCurrentDirectory(is_path)//恢复当前目录,如果改变了当前目录(如选择图片文件时),则f_cdw()可能找不到
  2963. ls_obj=iso
  2964. wf_asort('y1')
  2965. is_temp='footer'
  2966. for i=iis to 1 step -1
  2967. if io[i].otype='band' then
  2968. choose case left(io[i].oname,8)
  2969. case 'band_g_h'
  2970. is_temp='header.'+mid(io[i].oname,10)
  2971. case 'band_g_b'
  2972. is_temp='trailer.'+mid(io[i].oname,10)
  2973. case else//'band1','band2','band3','band4'
  2974. is_temp=io[i].oband
  2975. end choose
  2976. end if
  2977. if io[i].oband<>is_temp and pos('background,foreground',io[i].oband)=0 then
  2978. io[i].oband=is_temp//设置此对象的带区
  2979. end if
  2980. next
  2981. is_dw=''
  2982. li_cols=dw3.rowcount()
  2983. for i=1 to li_cols
  2984. ls_cols=ls_cols+char(13)+"column=(type="+dw3.object.ctype[i]
  2985. if dw3.object.cupdate[i]='yes' then ls_cols=ls_cols+" update=yes"
  2986. if dw3.object.cwhereclause[i]='yes' then ls_cols=ls_cols+" updatewhereclause=yes"
  2987. if dw3.object.ckey[i]='yes' then ls_cols=ls_cols+" key=yes"
  2988. if dw3.object.cidentity[i]='yes' then ls_cols=ls_cols+" identity=yes"
  2989. s[1]=dw3.object.cvalidation[i]
  2990. if s[1]>'' then
  2991. ls_cols=ls_cols+" validation='"+f_replace(s[1],"'","~~~'")+"'"
  2992. end if
  2993. s[1]=dw3.object.cvalidationmsg[i]
  2994. if s[1]>'' then
  2995. ls_cols=ls_cols+" validationmsg='"+f_replace(s[1],"'","~~~'")+"'"
  2996. end if
  2997. ls_cols=ls_cols+" name="+dw3.object.cname[i]
  2998. ls_cols=ls_cols+' dbname="'+dw3.object.cdbname[i]+'"'
  2999. ls_cols=ls_cols+' initial="'+dw3.object.cinitial[i]+'"'
  3000. for j=1 to iis
  3001. if io[j].otype='column' then
  3002. if pos(io[j].others,'{id='+string(i)+'}')>0 then exit
  3003. end if
  3004. next
  3005. if j>iis then//当column对象删除之后
  3006. ls_cols=ls_cols+' values="'+dw3.object.ctag[i]+'~t/"'//字段的中文名暂时放在column.values最安全,当column对象删除之后,还可以取出来
  3007. else
  3008. is_temp=dw3.object.cvalues[i]
  3009. if is_temp>'' then ls_cols=ls_cols+' values="'+is_temp+'"'
  3010. end if
  3011. ls_cols=ls_cols+')'
  3012. next
  3013. if id[1].ox1='5' then//composite
  3014. ls_cols=ls_cols+" unbound='yes' "
  3015. end if
  3016. io[iis+1]=id[1]//加上dw一行
  3017. for i=1 to iis+1
  3018. iso=io[i].oname
  3019. is_type=io[i].otype
  3020. if is_type='band' then//band1,band2,band3,band4,band_g
  3021. ll[6]=long(mid(iso,5,1))
  3022. if ll[6]>0 then//band1,band2,band3,band4
  3023. ll[ll[6]]=long(io[i].oy1) -ll[5] -1//
  3024. if ll[6]=2 then
  3025. is_temp='height.autosize='+io[i].oborder//只有detail有此属性
  3026. else
  3027. is_temp=''
  3028. end if
  3029. is_dw=is_dw+io[i].oband+"(height="+string(ll[ll[6]])+" "+is_temp+" color='"+io[i].ocolor+"')"
  3030. else//band_g_h_,band_g_b_
  3031. ll[6]=long(mid(iso,10))
  3032. if pos(iso,'band_g_h')=1 then//分组的中文信息is_oexp放在header.pointer属性中
  3033. ls_group[ll[6]]=char(13)+"group(level="+string(ll[6])+" header.height="+string(long(io[i].oy1) -ll[5] -1)+" header.pointer='"+io[i].otext+"' header.color='"+io[i].ocolor+"' newpage="+io[i].obcolor+" resetpagecount="+io[i].ofname
  3034. elseif pos(iso,'band_g_b')=1 then
  3035. ls_group[ll[6]]=ls_group[ll[6]]+" trailer.height="+string(long(io[i].oy1) -ll[5] -1)+" trailer.color='"+io[i].ocolor+"' by=('"+io[i].ofsize+"')"+")"
  3036. ls_groups=ls_group[ll[6]]+ls_groups
  3037. end if
  3038. end if
  3039. if iso<>'band4' then//此条件可以在页尾区下面存放不显示的对象
  3040. ll[5]=long(io[i].oy1)+13
  3041. end if
  3042. else
  3043. is_temp=''
  3044. if is_type='datawindow' then
  3045. s[1]=io[i].ox1
  3046. s[2]=io[i].oy1
  3047. s[3]=io[i].ox2
  3048. s[4]=io[i].oy2
  3049. else
  3050. if pos('background,foreground',io[i].oband)>0 then
  3051. ll[6]=0
  3052. else
  3053. ll[6]=ll[5]
  3054. end if
  3055. s[1]=string(long(io[i].ox1))
  3056. s[2]=string(long(io[i].oy1) -ll[6])
  3057. if is_type='line' then//
  3058. s[3]=string(long(io[i].ox2))
  3059. s[4]=string(long(io[i].oy2) -ll[6])
  3060. if pos(io[i].oname,'line2')=1 then//竖线修正
  3061. if s[2]='0' then
  3062. s[2]='-1'
  3063. elseif io[i].oband='header' then
  3064. s[4]=string(long(io[i].oy2) -ll[6]+1)
  3065. end if
  3066. end if
  3067. elseif is_type<>'line' then//
  3068. s[3]=string(long(io[i].ox2) -long(io[i].ox1))
  3069. s[4]=string(long(io[i].oy2) -long(io[i].oy1))
  3070. end if
  3071. end if
  3072. o=long(mid(ist,pos(ist,is_type) -2,2))
  3073. p=ii[2*o -1]
  3074. q=ii[2*o]
  3075. s[9]=io[i].others
  3076. j=0
  3077. for o=p to q
  3078. j++
  3079. choose case j
  3080. case 1
  3081. is_temp=' '+io[i].otype+'('
  3082. continue
  3083. case 2
  3084. s[5]=io[i].oname
  3085. case 3
  3086. s[5]=io[i].oband
  3087. case 4
  3088. s[5]=s[1]
  3089. case 5
  3090. s[5]=s[2]
  3091. case 6
  3092. s[5]=s[3]
  3093. case 7
  3094. s[5]=s[4]
  3095. case 8
  3096. s[5]=io[i].oborder
  3097. case 9
  3098. s[5]=io[i].otext
  3099. case 10
  3100. s[5]=io[i].ocolor
  3101. case 11
  3102. s[5]=io[i].obcolor
  3103. case 12
  3104. s[5]=io[i].ofname
  3105. case 13
  3106. s[5]=io[i].ofsize
  3107. case 14
  3108. s[5]=io[i].ofweight
  3109. case 15
  3110. s[5]=io[i].ofitalic
  3111. case 16
  3112. s[5]=io[i].ofunderline
  3113. case 17
  3114. s[5]=io[i].oalignment
  3115. case 18
  3116. s[5]=io[i].oexpression
  3117. end choose
  3118. s[7]='{'+is0[o]+'='
  3119. s[8]='}'
  3120. n=pos(s[9],s[7])
  3121. if n>0 then
  3122. m=pos(s[9],s[8],n)
  3123. s[6]=mid(s[9],n+len(s[7]),m -n -len(s[7]))
  3124. else
  3125. s[6]=''
  3126. end if
  3127. if j<19 then
  3128. if s[6]>'' and pos('?!',s[6])=0 then s[5]=s[5]+char(9)+s[6]
  3129. else
  3130. s[5]=s[6]
  3131. end if
  3132. if s[5]='' and is0[o]='background.mode' then s[5]='2'//background.mode在crosstab风格的dw中一定要有值
  3133. if pos('?!',s[5])>0 or (s[5]='' and pos(',text,checkbox.text,',is0[o])=0) then continue
  3134. s[5]=f_replace(s[5],"'","~~~'")
  3135. choose case is_type
  3136. case 'column'
  3137. if is0[o]='edit.style' then
  3138. ls_editstyle=s[5]+'.'
  3139. continue
  3140. elseif pos(is0[o],'edit.')+pos(is0[o],'checkbox.')+pos(is0[o],'dddw.')+pos(is0[o],'ddlb.')+pos(is0[o],'editmask.')+pos(is0[o],'radiobuttons.')=1 then
  3141. if pos(is0[o],ls_editstyle)=0 then continue
  3142. end if
  3143. case 'tableblob'
  3144. if is0[o]='dbname' then
  3145. li_cols++
  3146. is_temp=is_temp+' id='+string(li_cols)
  3147. ls_cols=ls_cols+char(13)+' column=(type=blob name='+io[i].oname+' dbname="'+io[i].ocolor+'")'
  3148. continue
  3149. elseif is0[o]='id' then
  3150. continue
  3151. end if
  3152. case 'datawindow'
  3153. ii_temp=idsx.object.data[o,2]
  3154. choose case io[i].ox1
  3155. case '1'//grid
  3156. if ii_temp>40 then continue
  3157. case '2'//label
  3158. if ii_temp>20 and ii_temp<50 then continue
  3159. case '4'//crosstab
  3160. if ii_temp>50 then continue
  3161. if pos(is0[o],'crosstab')=1 then
  3162. choose case is0[o]
  3163. case 'crosstab.dynamic'
  3164. case 'crosstabdata'
  3165. if f_rsx(id[1].others,'crosstab.dynamic')<>'yes' then
  3166. ls_cols=ls_cols+f_rsx(id[1].others,'crosstabdata')
  3167. end if
  3168. continue
  3169. case else
  3170. s[6]=idsx.object.data[o,5]
  3171. ls_crosstab=f_cdw('$1',ls_crosstab,is0[o],s[6],s[5],'','','','','')
  3172. continue
  3173. end choose
  3174. end if
  3175. case else//'0'
  3176. if ii_temp>20 then continue
  3177. end choose
  3178. end choose
  3179. s[6]=idsx.object.data[o,5]
  3180. is_temp=is_temp+' '+is0[o]+"="+s[6]+s[5]+s[6]
  3181. next
  3182. is_temp=is_temp+')'
  3183. if is_type='datawindow' then
  3184. is_temp=f_replace(is_temp,'row.resize=0','')//有row.resize=0会出错,但row.resize=1没有问题
  3185. ls_dw="release 11.5;"+is_temp
  3186. else
  3187. if is_type='column' then//为了处理PB本身的小BUG,即editmask.useformat=yes在'DataWindow.Syntax'会丢掉此属性
  3188. if pos(is_temp,'editmask.useformat=yes')>0 then
  3189. is_temp=f_replace(is_temp,"editmask.mask='","editmask.mask='editmask.useformat=yes")
  3190. end if
  3191. end if
  3192. licc++
  3193. lscc[licc]=string(io[i].occ)
  3194. lscc[licc]=lscc[licc]+space(8 -len(lscc[licc]))+is_temp
  3195. end if
  3196. end if
  3197. next
  3198. //////////////////////以下代码处理对象层次
  3199. long k
  3200. string lscc2
  3201. k=licc
  3202. do while k>0
  3203. k=k/2
  3204. For i=k To licc -1
  3205. For j=(i -k+1) To 1 Step -1
  3206. If long(left(lscc[j],8))<=long(left(lscc[j+k],8)) Then Exit
  3207. lscc2=lscc[j]
  3208. lscc[j]=lscc[j+k]
  3209. lscc[j+k]=lscc2
  3210. j=j -k +1
  3211. next
  3212. next
  3213. loop
  3214. for i=1 to licc
  3215. ls_modify=ls_modify+char(13)+mid(lscc[i],9)
  3216. next
  3217. //////////////////////////
  3218. is_dw=ls_dw+is_dw
  3219. if ls_crosstab>'' then ls_modify=ls_modify+char(13)+ls_crosstab+')'
  3220. is_update=''
  3221. if is_updatetable>'' then is_update=is_update+" update='"+is_updatetable+"'"
  3222. if is_updatewhere>'' then is_update=is_update+" updatewhere="+is_updatewhere
  3223. if is_updatekeyinplace>'' then is_update=is_update+" updatekeyinplace="+is_updatekeyinplace
  3224. is_dw=f_cdw(is_dw,ls_modify,ls_cols,istr_rpt.rsqlselect,is_update,istr_rpt.rprocedure,istr_rpt.rarguments,ls_groups,is_sparse,'"')
  3225. string ls_msg
  3226. if ids.create(is_dw,ls_msg) = -1 then
  3227. messagebox('错误','编辑格式,表达式内容错误或为空')
  3228. return 0
  3229. end if
  3230. is_dw=ids.describe('DataWindow.Syntax')//此两句不要删除,否则预览有时会出现非法错误.
  3231. wf_wdata()
  3232. is_dw=f_replace(is_dw,'editmask.mask="editmask.useformat=yes','editmask.useformat=yes editmask.mask="')//为了处理PB本身的小BUG,即editmask.useformat=yes在'DataWindow.Syntax'会丢掉此属性
  3233. io[iis+1]=id[2]//清空最后一行
  3234. iso=ls_obj
  3235. iio=wf_afind()
  3236. if iio>0 then is_type=io[iio].otype
  3237. return 1
  3238. end function
  3239. public function string wf_nest_arguments (string s_syntax);long ll1,ll2
  3240. ll1=pos(lower(s_syntax),' nest_arguments=')//PB6.5没有table.arguments属性,PB8.0就有了,不过是只读属性
  3241. if ll1>0 then
  3242. ll2=pos(s_syntax,'))',ll1)
  3243. return mid(s_syntax,ll1+11,ll2 -ll1 -9)
  3244. else
  3245. return ''
  3246. end if
  3247. end function
  3248. public function double wf_mm_to_unitsx (string ls_units, double ld_mm);double ld_rslt
  3249. IF ls_units = '0' THEN
  3250. ld_rslt = ld_mm * 17.27827217278272172782721727827217278272172782721727827217
  3251. ELSEIF ls_units = '1' THEN
  3252. ld_rslt = ld_mm * 3.77962203779622037796220377962203779622037796220377962203
  3253. ELSEIF ls_units = '2' THEN
  3254. ld_rslt = ld_mm * 0.0393700787401575
  3255. ELSEIF ls_units = '3' THEN
  3256. ld_rslt = ld_mm / 10
  3257. ELSE
  3258. ld_rslt = ld_mm * 17.27827217278272172782721727827217278272172782721727827217
  3259. END IF
  3260. return ld_rslt
  3261. end function
  3262. public function double wf_mm_to_unitsy (string ls_units, double ld_mm);double ld_rslt
  3263. IF ls_units = '0' THEN
  3264. ld_rslt = ld_mm * 15.1184881511848815118488151184881511848815118488151184881511848815
  3265. ELSEIF ls_units = '1' THEN
  3266. ld_rslt = ld_mm * 3.77962203779622037796220377962203779622037796220377962203
  3267. ELSEIF ls_units = '2' THEN
  3268. ld_rslt = ld_mm * 0.0393700787401575
  3269. ELSEIF ls_units = '3' THEN
  3270. ld_rslt = ld_mm / 10
  3271. ELSE
  3272. ld_rslt = ld_mm * 15.1184881511848815118488151184881511848815118488151184881511848815
  3273. END IF
  3274. return ld_rslt
  3275. end function
  3276. public function double wf_unitsx_to_mm (string ls_units, double ld_unit);double ld_rslt
  3277. IF ls_units = '0' THEN
  3278. ld_rslt = ld_unit / 17.27827217278272172782721727827217278272172782721727827217
  3279. ELSEIF ls_units = '1' THEN
  3280. ld_rslt = ld_unit / 3.77962203779622037796220377962203779622037796220377962203
  3281. ELSEIF ls_units = '2' THEN
  3282. ld_rslt = ld_unit / 0.0393700787401575
  3283. ELSEIF ls_units = '3' THEN
  3284. ld_rslt = ld_unit * 10
  3285. ELSE
  3286. ld_rslt = ld_unit / 17.27827217278272172782721727827217278272172782721727827217
  3287. END IF
  3288. return ld_rslt
  3289. end function
  3290. public function double wf_unitsy_to_mm (string ls_units, double ld_unit);double ld_rslt
  3291. IF ls_units = '0' THEN
  3292. ld_rslt = ld_unit / 15.1184881511848815118488151184881511848815118488151184881511848815
  3293. ELSEIF ls_units = '1' THEN
  3294. ld_rslt = ld_unit / 3.77962203779622037796220377962203779622037796220377962203
  3295. ELSEIF ls_units = '2' THEN
  3296. ld_rslt = ld_unit / 0.0393700787401575
  3297. ELSEIF ls_units = '3' THEN
  3298. ld_rslt = ld_unit * 10
  3299. ELSE
  3300. ld_rslt = ld_unit / 15.1184881511848815118488151184881511848815118488151184881511848815
  3301. END IF
  3302. return ld_rslt
  3303. end function
  3304. on w_rpt_main.create
  3305. int iCurrent
  3306. call super::create
  3307. if this.MenuName = "m_rpt_main" then this.MenuID = create m_rpt_main
  3308. this.mdi_1=create mdi_1
  3309. this.cb_hidebackgroud=create cb_hidebackgroud
  3310. this.cb_setbackgroud=create cb_setbackgroud
  3311. this.dw3=create dw3
  3312. this.dwx=create dwx
  3313. this.dwy=create dwy
  3314. this.ddlb_1=create ddlb_1
  3315. this.ddlb_2=create ddlb_2
  3316. this.ln_1=create ln_1
  3317. this.dwc1=create dwc1
  3318. this.st_1=create st_1
  3319. this.sle_1=create sle_1
  3320. this.dw1=create dw1
  3321. this.dwc2=create dwc2
  3322. this.cbx_lock=create cbx_lock
  3323. iCurrent=UpperBound(this.Control)
  3324. this.Control[iCurrent+1]=this.mdi_1
  3325. this.Control[iCurrent+2]=this.cb_hidebackgroud
  3326. this.Control[iCurrent+3]=this.cb_setbackgroud
  3327. this.Control[iCurrent+4]=this.dw3
  3328. this.Control[iCurrent+5]=this.dwx
  3329. this.Control[iCurrent+6]=this.dwy
  3330. this.Control[iCurrent+7]=this.ddlb_1
  3331. this.Control[iCurrent+8]=this.ddlb_2
  3332. this.Control[iCurrent+9]=this.ln_1
  3333. this.Control[iCurrent+10]=this.dwc1
  3334. this.Control[iCurrent+11]=this.st_1
  3335. this.Control[iCurrent+12]=this.sle_1
  3336. this.Control[iCurrent+13]=this.dw1
  3337. this.Control[iCurrent+14]=this.dwc2
  3338. this.Control[iCurrent+15]=this.cbx_lock
  3339. end on
  3340. on w_rpt_main.destroy
  3341. call super::destroy
  3342. if IsValid(MenuID) then destroy(MenuID)
  3343. destroy(this.mdi_1)
  3344. destroy(this.cb_hidebackgroud)
  3345. destroy(this.cb_setbackgroud)
  3346. destroy(this.dw3)
  3347. destroy(this.dwx)
  3348. destroy(this.dwy)
  3349. destroy(this.ddlb_1)
  3350. destroy(this.ddlb_2)
  3351. destroy(this.ln_1)
  3352. destroy(this.dwc1)
  3353. destroy(this.st_1)
  3354. destroy(this.sle_1)
  3355. destroy(this.dw1)
  3356. destroy(this.dwc2)
  3357. destroy(this.cbx_lock)
  3358. end on
  3359. event open;call super::open;lm_rpt_main = m_rpt_main
  3360. is_rid = istr_rpt.rid //报表编号
  3361. is_rname = istr_rpt.rcname//报表名称
  3362. id_userdw = istr_rpt.userdw//前台报表设计时共享的用户数据dw
  3363. is_auto = istr_rpt.auto
  3364. is_datasource = istr_rpt.DataSource //区分后台、前台,前台='dw'
  3365. it_report = istr_rpt.transation//数据库连接
  3366. ib_save_flag = istr_rpt.save_flag
  3367. import_flag = istr_rpt.import_flag
  3368. ls_pblpath = istr_rpt.pblpath
  3369. ifreport = istr_rpt.ifreport
  3370. //取格式
  3371. if f_get_dwcomment(istr_rpt.pblpath,istr_rpt.oname,ls_comments,is_errors) = 0 then
  3372. messagebox('错误',is_errors, StopSign!, OK! )
  3373. return
  3374. end if
  3375. ids = CREATE datastore
  3376. idsx = CREATE datastore
  3377. idsx.DataObject = 'dw_rpt_cysx65'
  3378. ii_rows = idsx.RowCount()
  3379. is_type = ''
  3380. ii_temp = 0
  3381. FOR i = 1 TO ii_rows
  3382. is0[i] = idsx.Object.Data[i,3]
  3383. IF is_type <> idsx.Object.Data[i,1] THEN
  3384. is_type = idsx.Object.Data[i,1]
  3385. ii_temp++
  3386. ist = ist+String(ii_temp,'00')+is_type
  3387. ii[ii_temp*2 -1] = i
  3388. IF ii_temp > 1 THEN
  3389. ii[ii_temp*2 -2] = i -1
  3390. END IF
  3391. END IF
  3392. NEXT
  3393. ii[ii_temp*2] = ii_rows
  3394. IF is_auto = 'auto' THEN //自动
  3395. IF is_datasource = 'dw' THEN//前台报表
  3396. ids.Create(id_userdw.Describe('DataWindow.Syntax'))
  3397. ids.SetTransObject(it_report)
  3398. wf_read('all')
  3399. ELSE
  3400. wf_dwinit()
  3401. END IF
  3402. POST EVENT ue_auto()
  3403. ELSE
  3404. Blob lblob
  3405. SELECTBLOB Rpsyntax INTO :lblob FROM u_report_list Where rpid = :is_rid USING it_report;
  3406. IF it_report.SQLCode = 0 THEN
  3407. is_dw = String(lblob, EncodingANSI!)
  3408. IF IsNull(is_dw) THEN
  3409. wf_band4(50,50,50,50,0)
  3410. wf_dwinit()
  3411. ELSE
  3412. ids.Create(is_dw,is_errors)
  3413. ids.SetTransObject(it_report)
  3414. wf_read('all')
  3415. END IF
  3416. END IF
  3417. END IF
  3418. //创建动态数据窗口dw1及所有对象
  3419. s[1] = "release 6;datawindow(units=1 processing=0 color="+id[1].oband+") detail(height="+String(ii_y_max)+" color='536870912') table(column=(type=long name=zkl0 dbname='zkl0')) text(band=detail visible='0' text='' x='"+String(ii_x_max)+"' y='1' height='1' width='1')"
  3420. dw1.Create(s[1],is_errors)
  3421. dw1.InsertRow(0)
  3422. wf_obj0() //根据对象不同分别生成Modify语句并执行
  3423. m_rpt_main.m_1.m_line1.ToolbarItemName = 'line1.bmp' //横线
  3424. m_rpt_main.m_1.m_line2.ToolbarItemName = 'line2.bmp'//竖线
  3425. m_rpt_main.m_1.m_edit.ToolbarItemName = 'field.bmp'//表达式
  3426. Title = Title+'('+is_rname+')'
  3427. f_getfont(ddlb_1)
  3428. //Open(w_rpt_statbar)
  3429. ib_resize_statbar = true
  3430. f_statbar('t1',' 龙嘉自定义报表设计器')
  3431. f_statbar('t2','选中对象个数:0')
  3432. dw1.SetFocus()
  3433. IF is_auto <> 'auto' THEN
  3434. ii_save = 0
  3435. END IF
  3436. GetCurrentDirectoryA(256,is_path) //读取当前目录
  3437. end event
  3438. event closequery;
  3439. IF import_flag THEN
  3440. Close(w_rpt_statbar)
  3441. ELSE
  3442. IF ii_save > 0 THEN
  3443. CHOOSE CASE MessageBox('提示信息','数据已修改,是否存盘?',QUESTION!,YESNOCANCEL!,1)
  3444. CASE 1
  3445. EVENT ue_save()
  3446. CASE 3
  3447. RETURN 1
  3448. END CHOOSE
  3449. END IF
  3450. DESTROY ids
  3451. DESTROY idsx
  3452. Close(w_rpt_statbar)
  3453. END IF
  3454. end event
  3455. event resize;dwy.Height = (newheight -dwy.Y )
  3456. dwx.Width = newwidth -dwx.X
  3457. dw1.Resize(newwidth -dw1.X ,(newheight -dw1.Y))
  3458. st_1.Width = newwidth
  3459. ln_1.EndX = newwidth
  3460. //if isvalid(w_rpt_statbar) then w_rpt_statbar.event resize(0,0,0)
  3461. end event
  3462. event activate;dw1.setfocus()
  3463. toolbarvisible=true
  3464. end event
  3465. event key;call super::key;IF KeyDown(KeyControl!) AND KeyDown(KeyS!) THEN
  3466. THIS.TriggerEvent('ue_save')
  3467. ELSEIF KeyDown( KeyEscape!) THEN
  3468. Close(THIS)
  3469. END IF
  3470. end event
  3471. event close;call super::close;IF ifilename <> '' THEN
  3472. FileDelete(ifilename)
  3473. END IF
  3474. end event
  3475. type mdi_1 from mdiclient within w_rpt_main
  3476. long BackColor=268435456
  3477. end type
  3478. type cb_hidebackgroud from commandbutton within w_rpt_main
  3479. integer x = 3104
  3480. integer y = 100
  3481. integer width = 274
  3482. integer height = 92
  3483. integer taborder = 70
  3484. integer textsize = -9
  3485. integer weight = 400
  3486. fontcharset fontcharset = gb2312charset!
  3487. fontpitch fontpitch = variable!
  3488. string facename = "宋体"
  3489. boolean enabled = false
  3490. string text = "隐藏背景"
  3491. end type
  3492. event clicked;dw1.SetRedraw(False)
  3493. string ls_visible
  3494. ls_visible = dw1.Describe(ibackgroudname+".visible")
  3495. if ls_visible = '0' then
  3496. dw1.Modify(ibackgroudname+".visible='1'")
  3497. this.Text = '隐藏背景'
  3498. elseif ls_visible = '1' then
  3499. dw1.Modify(ibackgroudname+".visible='0'")
  3500. this.Text = '显示背景'
  3501. cbx_lock.Checked = true
  3502. cb_setbackgroud.Enabled = Not cbx_lock.checked
  3503. end if
  3504. dw1.SetRedraw(True)
  3505. end event
  3506. type cb_setbackgroud from commandbutton within w_rpt_main
  3507. integer x = 2834
  3508. integer y = 100
  3509. integer width = 274
  3510. integer height = 92
  3511. integer taborder = 70
  3512. integer textsize = -9
  3513. integer weight = 400
  3514. fontcharset fontcharset = gb2312charset!
  3515. fontpitch fontpitch = variable!
  3516. string facename = "宋体"
  3517. string text = "套打背景"
  3518. end type
  3519. event clicked;Long cnt
  3520. String ls_filepath, ls_type
  3521. Blob back_data
  3522. String arg_msg
  3523. String ls_units
  3524. ls_units = dw1.Describe("DataWindow.Units")
  3525. FOR i = 1 To iis
  3526. IF io[i].oname = ibackgroudname THEN
  3527. EXIT
  3528. END IF
  3529. NEXT
  3530. IF i <= iis THEN // 已插入背景
  3531. s_tran.X = wf_unitsx_to_mm(ls_units, Double(io[i].ox1))
  3532. s_tran.Y = wf_unitsx_to_mm(ls_units, Double(io[i].oy1))
  3533. s_tran.Width = wf_unitsx_to_mm(ls_units, Double(io[i].ox2) - Double(io[i].ox1))
  3534. s_tran.Height = wf_unitsx_to_mm(ls_units, Double(io[i].oy2) - Double(io[i].oy1))
  3535. s_tran.Filename = io[i].otext
  3536. OpenWithParm(w_taoda_backgroud_setting, s_tran)
  3537. s_tran = Message.PowerObjectParm
  3538. IF s_tran.ifok = 0 THEN RETURN
  3539. io[i].otext = s_tran.Filename
  3540. s_tran.X = wf_mm_to_unitsx(ls_units, s_tran.X)
  3541. s_tran.Width = wf_mm_to_unitsx(ls_units, s_tran.Width)
  3542. s_tran.Y = wf_mm_to_unitsy(ls_units, s_tran.Y)
  3543. s_tran.Height = wf_mm_to_unitsy(ls_units, s_tran.Height)
  3544. io[i].ox1 = String(s_tran.X)
  3545. io[i].oy1 = String(s_tran.Y)
  3546. io[i].ox2 = String(Double(io[i].ox1)+s_tran.Width)
  3547. io[i].oy2 = String(Double(io[i].oy1)+s_tran.Height)
  3548. wf_object(i,1)
  3549. ELSE
  3550. // DONE: 获取当前DW的套打图片与坐标
  3551. SELECT count(0)
  3552. INTO :cnt
  3553. FROM sys_dwprint_background
  3554. Where dwname = :is_rname;
  3555. IF sqlca.SQLCode <> 0 THEN cnt = 0
  3556. IF cnt > 0 THEN
  3557. SELECT back_x, back_y, back_width, back_height, newid(), back_type
  3558. INTO :s_tran.x, :s_tran.y, :s_tran.width, :s_tran.height, :ls_filepath, :ls_type
  3559. FROM sys_dwprint_background
  3560. Where dwname = :is_rname;
  3561. IF sqlca.SQLCode <> 0 THEN
  3562. MessageBox('ERROR', '查询背景图坐标失败,' + sqlca.SQLErrText)
  3563. RETURN
  3564. END IF
  3565. IF ifilename = '' THEN // 文件未下载过
  3566. SelectBlob back_data
  3567. Into :back_data
  3568. From sys_dwprint_background
  3569. Where dwname = :is_rname;
  3570. IF sqlca.SQLCode <> 0 THEN
  3571. MessageBox('ERROR', '查询背景图内容失败,' + sqlca.SQLErrText)
  3572. RETURN
  3573. END IF
  3574. ls_filepath = sys_cur_path + ins_fjtemppath + "\" + ls_filepath + "." + ls_type
  3575. IF Not IsNull(back_data) THEN
  3576. IF f_blobtofile(ls_filepath, back_data, Ref arg_msg) <> 1 THEN
  3577. MessageBox('ERROR', '保存背景图失败,' + arg_msg)
  3578. RETURN
  3579. END IF
  3580. ifilename = ls_filepath
  3581. s_tran.Filename = ifilename
  3582. ELSE
  3583. s_tran.Filename = ''
  3584. END IF
  3585. ELSE // 图片已经下载过
  3586. s_tran.Filename = ifilename
  3587. END IF
  3588. ELSE
  3589. s_tran.X = 0
  3590. s_tran.Y = 4
  3591. s_tran.Width = 230
  3592. s_tran.Height = 127
  3593. s_tran.Filename = '快递套打.jpg'
  3594. END IF
  3595. OpenWithParm(w_taoda_backgroud_setting, s_tran)
  3596. s_tran = Message.PowerObjectParm
  3597. IF s_tran.ifok = 0 THEN RETURN
  3598. iis++
  3599. iio = iis
  3600. io[iio].oname = ibackgroudname
  3601. io[iio].occ = wf_occ(1)+1
  3602. iic = 1
  3603. io[iio].oselect = '1'
  3604. i = iio
  3605. io[i].otext = s_tran.Filename
  3606. s_tran.X = wf_mm_to_unitsx(ls_units, s_tran.X)
  3607. s_tran.Width = wf_mm_to_unitsx(ls_units, s_tran.Width)
  3608. s_tran.Y = wf_mm_to_unitsy(ls_units, s_tran.Y)
  3609. s_tran.Height = wf_mm_to_unitsy(ls_units, s_tran.Height)
  3610. io[i].ox1 = String(s_tran.X)
  3611. io[i].oy1 = String(s_tran.Y)
  3612. io[i].ox2 = String(double(io[i].ox1)+s_tran.Width)
  3613. io[i].oy2 = String(double(io[i].oy1)+s_tran.Height)
  3614. io[i].oborder = '2'
  3615. io[i].otype = 'bitmap'
  3616. io[i].oband = is_band
  3617. wf_object(i,0)
  3618. wf_setcolor()
  3619. Parent.Trigger Event ue_cc(0)
  3620. cb_hidebackgroud.Enabled = True
  3621. cbx_lock.Enabled = True
  3622. END IF
  3623. end event
  3624. type dw3 from datawindow within w_rpt_main
  3625. boolean visible = false
  3626. integer x = 475
  3627. integer y = 40
  3628. integer width = 2757
  3629. integer height = 492
  3630. integer taborder = 70
  3631. boolean bringtotop = true
  3632. string dataobject = "dw_rpt_column"
  3633. boolean hscrollbar = true
  3634. boolean vscrollbar = true
  3635. boolean resizable = true
  3636. boolean hsplitscroll = true
  3637. boolean livescroll = true
  3638. end type
  3639. type dwx from datawindow within w_rpt_main
  3640. event ue_mousemove pbm_dwnmousemove
  3641. string tag = "PB预览的标尺不准"
  3642. integer x = 64
  3643. integer y = 200
  3644. integer width = 1737
  3645. integer height = 68
  3646. boolean bringtotop = true
  3647. string dataobject = "dw_xruler"
  3648. boolean border = false
  3649. end type
  3650. event ue_mousemove;//鼠标移动到dw1之外时触发事件
  3651. //功能:拖动鼠标超过边界时自动移动,好像在Excel软件中拖动鼠标一样。
  3652. ii_outside=4
  3653. parent.postevent('ue_outside')
  3654. end event
  3655. event constructor;insertrow(0)
  3656. end event
  3657. type dwy from datawindow within w_rpt_main
  3658. event ue_mousemove pbm_dwnmousemove
  3659. string tag = "PB预览的标尺不准"
  3660. integer y = 260
  3661. integer width = 69
  3662. integer height = 1060
  3663. boolean bringtotop = true
  3664. string dataobject = "dw_yruler"
  3665. boolean border = false
  3666. end type
  3667. event ue_mousemove;//鼠标移动到dw1之外时触发事件//左边界
  3668. //功能:拖动鼠标超过边界时自动移动,好像在Excel软件中拖动鼠标一样。
  3669. ii_outside=3
  3670. parent.postevent('ue_outside')
  3671. end event
  3672. event constructor;insertrow(0)
  3673. end event
  3674. type ddlb_1 from dropdownlistbox within w_rpt_main
  3675. integer x = 896
  3676. integer y = 104
  3677. integer width = 782
  3678. integer height = 804
  3679. integer taborder = 50
  3680. integer textsize = -9
  3681. integer weight = 400
  3682. fontcharset fontcharset = gb2312charset!
  3683. fontpitch fontpitch = variable!
  3684. string facename = "宋体"
  3685. long backcolor = 16777215
  3686. string text = "宋体"
  3687. boolean vscrollbar = true
  3688. borderstyle borderstyle = stylelowered!
  3689. end type
  3690. event selectionchanged;wf_allset('fname',text)
  3691. end event
  3692. type ddlb_2 from dropdownlistbox within w_rpt_main
  3693. integer x = 1682
  3694. integer y = 104
  3695. integer width = 192
  3696. integer height = 804
  3697. integer taborder = 60
  3698. integer textsize = -9
  3699. integer weight = 400
  3700. fontcharset fontcharset = gb2312charset!
  3701. fontpitch fontpitch = variable!
  3702. string facename = "宋体"
  3703. long backcolor = 16777215
  3704. string text = "9"
  3705. boolean allowedit = true
  3706. boolean sorted = false
  3707. boolean vscrollbar = true
  3708. string item[] = {"8","9","10","11","12","14","16","18","20","22","24","26","28","36","48","72"}
  3709. borderstyle borderstyle = stylelowered!
  3710. end type
  3711. event selectionchanged;wf_allset('fsize',text)
  3712. end event
  3713. event modified;wf_allset('fsize',text)
  3714. end event
  3715. type ln_1 from line within w_rpt_main
  3716. long linecolor = 16777215
  3717. integer linethickness = 4
  3718. integer beginy = 196
  3719. integer endx = 3419
  3720. integer endy = 196
  3721. end type
  3722. type dwc1 from datawindow within w_rpt_main
  3723. event ue_mousemove pbm_dwnmousemove
  3724. integer x = 1902
  3725. integer y = 100
  3726. integer width = 919
  3727. integer height = 88
  3728. integer taborder = 30
  3729. boolean bringtotop = true
  3730. string dataobject = "dw_rpt_color1"
  3731. boolean border = false
  3732. boolean livescroll = true
  3733. end type
  3734. event ue_mousemove;if not isvalid(dwo) then return
  3735. choose case dwo.name
  3736. case 'qjst','t','qjs'
  3737. if object.qjst.border='0' then
  3738. object.t.border='6'
  3739. object.qjst.border='6'
  3740. else
  3741. end if
  3742. case 'bjst','b','bjs'
  3743. if object.bjst.border='0' then
  3744. object.b.border='6'
  3745. object.bjst.border='6'
  3746. else
  3747. end if
  3748. case else
  3749. if is_scolor<>'qjst' then
  3750. object.t.border='0'
  3751. object.qjst.border='0'
  3752. end if
  3753. if is_scolor<>'bjst' then
  3754. object.bjst.border='0'
  3755. object.b.border='0'
  3756. end if
  3757. end choose
  3758. end event
  3759. event clicked;if not isvalid(dwo) then return
  3760. choose case dwo.name
  3761. case 'qjst'//↓前景色
  3762. if is_scolor<>'qjst' then
  3763. object.bjst.border='0'
  3764. object.b.border='0'
  3765. object.qjst.border='5'
  3766. dwc2.x=1902
  3767. s[1]=object.qjs.background.color
  3768. is_scolor='qjst'
  3769. dwc2.uf_scolor(s[1])
  3770. else
  3771. dwc2.event ue_close()
  3772. end if
  3773. case 'qjs','t'//前景色
  3774. wf_allset('color',object.qjs.background.color)
  3775. object.t.border='5'
  3776. case 'bjs','b'//前景色
  3777. wf_allset('bcolor',object.bjs.background.color)
  3778. object.b.border='5'
  3779. case 'bjst'//↓背景色
  3780. if is_scolor<>'bjst' then
  3781. object.qjst.border='0'
  3782. object.t.border='0'
  3783. object.bjst.border='5'
  3784. dwc2.x=2358
  3785. s[1]=object.bjs.background.color
  3786. is_scolor='bjst'
  3787. dwc2.uf_scolor(s[1])
  3788. else
  3789. dwc2.event ue_close()
  3790. end if
  3791. end choose
  3792. end event
  3793. type st_1 from statictext within w_rpt_main
  3794. integer y = 96
  3795. integer width = 3794
  3796. integer height = 100
  3797. integer textsize = -9
  3798. integer weight = 400
  3799. fontcharset fontcharset = gb2312charset!
  3800. fontpitch fontpitch = variable!
  3801. string facename = "宋体"
  3802. long textcolor = 80269524
  3803. long backcolor = 80269524
  3804. boolean border = true
  3805. borderstyle borderstyle = styleraised!
  3806. boolean focusrectangle = false
  3807. end type
  3808. type sle_1 from singlelineedit within w_rpt_main
  3809. integer x = 9
  3810. integer y = 104
  3811. integer width = 878
  3812. integer height = 80
  3813. integer taborder = 40
  3814. boolean bringtotop = true
  3815. integer textsize = -9
  3816. integer weight = 400
  3817. fontcharset fontcharset = gb2312charset!
  3818. fontpitch fontpitch = variable!
  3819. string facename = "宋体"
  3820. long backcolor = 16777215
  3821. boolean enabled = false
  3822. borderstyle borderstyle = stylelowered!
  3823. end type
  3824. event modified;io[iio].otext=text
  3825. wf_object(iio,1)
  3826. end event
  3827. type dw1 from datawindow within w_rpt_main
  3828. event ue_lbuttonup pbm_dwnlbuttonup
  3829. event ue_key pbm_dwnkey
  3830. event ue_mousemove pbm_dwnmousemove
  3831. string tag = "lse"
  3832. integer x = 64
  3833. integer y = 264
  3834. integer width = 1733
  3835. integer height = 1052
  3836. integer taborder = 10
  3837. boolean hscrollbar = true
  3838. boolean vscrollbar = true
  3839. boolean border = false
  3840. boolean livescroll = true
  3841. end type
  3842. event ue_lbuttonup;//左鼠标弹起时触发事件
  3843. Long ll_x1,ll_y1,ll_x2,ll_y2,j,ll_width,ll_width_min = 99999
  3844. xpos = xpos+ii_x_scroll
  3845. ypos = ypos+ii_y_scroll
  3846. IF is_toolbar = '' THEN
  3847. IF iio > 0 THEN
  3848. CHOOSE CASE io[iio].otype
  3849. CASE 'line'
  3850. is_point = 'mouseup'
  3851. CASE 'band','text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3852. is_point = 'lbuttonup'
  3853. CASE 'temp'
  3854. is_point = 'lbuttonup'
  3855. ll_x1 = Min(Long(io[iio].ox1),Long(io[iio].ox2))
  3856. ll_y1 = Min(Long(io[iio].oy1),Long(io[iio].oy2))
  3857. ll_x2 = Max(Long(io[iio].ox1),Long(io[iio].ox2))
  3858. ll_y2 = Max(Long(io[iio].oy1),Long(io[iio].oy2))
  3859. FOR i = 1 To iis
  3860. IF cbx_lock.Checked And io[i].otype = 'bitmap' And io[i].oname = ibackgroudname THEN CONTINUE
  3861. If (ll_x1 > Long(io[i].ox1) And ll_x1 > Long(io[i].ox2)) Or (ll_x2 < Long(io[i].ox1) And ll_x2 < Long(io[i].ox2)) &
  3862. Or (ll_y1 > Long(io[i].oy1) And ll_y1 > Long(io[i].oy2)) Or (ll_y2 < Long(io[i].oy1) And ll_y2 < Long(io[i].oy2)) THEN
  3863. ELSE
  3864. IF io[i].oselect < '1' And io[i].otype <> 'band' THEN
  3865. iic++
  3866. io[i].oselect = String(iic)
  3867. END IF
  3868. END IF
  3869. NEXT
  3870. Modify('destroy temp')
  3871. iio = 0
  3872. iso = ''
  3873. wf_setcolor()
  3874. END CHOOSE
  3875. END IF
  3876. ELSE
  3877. IF iio = iis+2 THEN //sep1
  3878. SetRedraw(False)
  3879. is_point = 'lbuttonup'
  3880. ll_x1 = Long(io[iio].ox1)
  3881. ll_width = Long(io[iio].ox2) -Long(io[iio].ox1)
  3882. FOR i = 1 To iis //中间穿过的对象
  3883. IF Long(io[i].ox1) < ll_x1 And Long(io[i].ox2) >= ll_x1 And io[i].otype <> 'band' THEN
  3884. ll_width_min = Min(ll_width_min,Abs(Long(io[i].ox2) -Long(io[i].ox1)))
  3885. END IF
  3886. NEXT
  3887. IF ll_width_min > -ll_width And ll_width_min < 99999 THEN
  3888. FOR i = 1 To iis
  3889. IF Long(io[i].ox1) < ll_x1 And Long(io[i].ox2) >= ll_x1 THEN //中间穿过的对象
  3890. io[i].ox2 = String(Long(io[i].ox2)+ll_width)
  3891. ELSEIF Long(io[i].ox1) >= ll_x1 THEN // 右边的对象
  3892. io[i].ox1 = String(Long(io[i].ox1)+ll_width)
  3893. io[i].ox2 = String(Long(io[i].ox2)+ll_width)
  3894. END IF
  3895. wf_object(i,1)
  3896. NEXT
  3897. END IF
  3898. Modify('destroy sep1')
  3899. SetRedraw(True)
  3900. iso = ''
  3901. iio = 0
  3902. END IF
  3903. END IF
  3904. RETURN
  3905. end event
  3906. event ue_key;//键盘操作触发事件
  3907. if key=Keyleftarrow! or key=Keyrightarrow! or key=Keyuparrow! or key=Keydownarrow! or key=Keydelete! then
  3908. SetRedraw(false)
  3909. if iic=1 and left(iso,4)='band' then //带区选择
  3910. choose case key
  3911. case Keyuparrow!
  3912. if long(io[iio].oy1) - 1>ii_topformove+1 then
  3913. wf_aftermove(-1,1)
  3914. wf_object(iio,1)
  3915. end if
  3916. case Keydownarrow!
  3917. wf_aftermove(1,1)
  3918. wf_object(iio,1)
  3919. end choose
  3920. else
  3921. for i=1 to iis
  3922. if io[i].oselect>'0' then
  3923. choose case keyflags
  3924. case 1 // shift
  3925. choose case key
  3926. case Keyleftarrow!
  3927. choose case io[i].otype
  3928. case 'line'
  3929. choose case left(io[i].oname,5)
  3930. case 'line1','line3'
  3931. io[i].ox2=string(long(io[i].ox2) - 1)
  3932. wf_object(i,1)
  3933. end choose
  3934. case 'text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3935. io[i].ox2=string(long(io[i].ox2) - 1)
  3936. wf_object(i,1)
  3937. end choose
  3938. case Keyrightarrow!
  3939. choose case io[i].otype
  3940. case 'line'
  3941. choose case left(io[i].oname,5)
  3942. case 'line1','line3'
  3943. io[i].ox2=string(long(io[i].ox2)+1)
  3944. wf_object(i,1)
  3945. end choose
  3946. case 'text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3947. io[i].ox2=string(long(io[i].ox2)+1)
  3948. wf_object(i,1)
  3949. end choose
  3950. case Keyuparrow!
  3951. choose case io[i].otype
  3952. case 'line'
  3953. choose case left(io[i].oname,5)
  3954. case 'line2','line3'
  3955. io[i].oy2=string(long(io[i].oy2) - 1)
  3956. wf_object(i,1)
  3957. end choose
  3958. case 'text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3959. io[i].oy2=string(long(io[i].oy2) - 1)
  3960. wf_object(i,1)
  3961. end choose
  3962. case Keydownarrow!
  3963. choose case io[i].otype
  3964. case 'line'
  3965. choose case left(io[i].oname,5)
  3966. case 'line2','line3'
  3967. io[i].oy2=string(long(io[i].oy2)+1)
  3968. wf_object(i,1)
  3969. end choose
  3970. case 'text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3971. io[i].oy2=string(long(io[i].oy2)+1)
  3972. wf_object(i,1)
  3973. end choose
  3974. end choose
  3975. case 2
  3976. case 3
  3977. case else // no shift
  3978. choose case key
  3979. case Keyleftarrow!
  3980. choose case io[i].otype
  3981. case 'line','text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3982. io[i].ox1=string(long(io[i].ox1) - 1)
  3983. io[i].ox2=string(long(io[i].ox2) - 1)
  3984. wf_object(i,1)
  3985. end choose
  3986. case Keyrightarrow!
  3987. choose case io[i].otype
  3988. case 'line','text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3989. io[i].ox1=string(long(io[i].ox1)+1)
  3990. io[i].ox2=string(long(io[i].ox2)+1)
  3991. wf_object(i,1)
  3992. end choose
  3993. case Keyuparrow!
  3994. choose case io[i].otype
  3995. case 'line','text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  3996. io[i].oy1=string(long(io[i].oy1) - 1)
  3997. io[i].oy2=string(long(io[i].oy2) - 1)
  3998. wf_object(i,1)
  3999. case 'band'
  4000. io[i].oy1=string(long(io[i].oy1) - 1)
  4001. io[i].oy2=string(long(io[i].oy2) - 1)
  4002. wf_object(i,1)
  4003. end choose
  4004. case Keydownarrow!
  4005. choose case io[i].otype
  4006. case 'line','text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  4007. io[i].oy1=string(long(io[i].oy1)+1)
  4008. io[i].oy2=string(long(io[i].oy2)+1)
  4009. wf_object(i,1)
  4010. case 'band'
  4011. io[i].oy1=string(long(io[i].oy1)+1)
  4012. io[i].oy2=string(long(io[i].oy2)+1)
  4013. wf_object(i,1)
  4014. end choose
  4015. end choose
  4016. end choose
  4017. end if
  4018. next
  4019. end if
  4020. if key=Keydelete! then // 对象删除
  4021. parent.event ue_delobj()
  4022. end if
  4023. if iso='sep1' and keydown(KeyLeftButton!) then
  4024. choose case key
  4025. case Keyleftarrow!
  4026. io[iio].ox2=string(long(io[iio].ox2) - 1)
  4027. wf_object(iio,1)
  4028. ii_x=ii_x - 1
  4029. case Keyrightarrow!
  4030. io[iio].ox2=string(long(io[iio].ox2)+1)
  4031. wf_object(iio,1)
  4032. ii_x=ii_x+1
  4033. end choose
  4034. end if
  4035. SetRedraw(true)
  4036. end if
  4037. return 1
  4038. end event
  4039. event ue_mousemove;xpos=xpos+ii_x_scroll
  4040. ypos=ypos+ii_y_scroll
  4041. if (xpos=ii_x_old and ypos=ii_y_old) or ((KeyDown(Keyshift!) or KeyDown(KeyControl!)) and iso<>'temp') then
  4042. else
  4043. dwx.modify("l_x.x1='"+string(xpos)+"' l_x.x2='"+string(xpos)+"'")
  4044. dwy.modify("l_y.y1='"+string(ypos)+"' l_y.y2='"+string(ypos)+"'")
  4045. f_statbar('t3','X:'+string(int(xpos*ln_bl)*0.01)+'cm'+mid(space(7),len(string(int(xpos*ln_bl)*0.01)))+'Y:'+string(int(ypos*ln_bl)*0.01)+'cm')
  4046. SetRedraw(false)
  4047. if iic>1 then //多重选择
  4048. if is_point='move' and keydown(KeyLeftButton!) then
  4049. for i=1 to iis
  4050. // if (ypos - ii_y)<0 then
  4051. // iio=i
  4052. // else
  4053. // iio=iis - i+1
  4054. // end if
  4055. // is_label=dw2.getitemstring(iio,'oselect')
  4056. if io[i].oselect>'0' then
  4057. choose case io[i].otype
  4058. case 'line','text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  4059. io[i].ox1=string(long(io[i].ox1)+xpos - ii_x)
  4060. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4061. io[i].ox2=string(long(io[i].ox2)+xpos - ii_x)
  4062. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4063. case 'band'
  4064. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4065. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4066. end choose
  4067. wf_object(i,1)
  4068. end if
  4069. next
  4070. ii_x=xpos
  4071. ii_y=ypos
  4072. elseif iio=iis+1 then//iso='temp'
  4073. if keydown(KeyLeftButton!) then
  4074. io[iio].ox2=string(xpos)
  4075. io[iio].oy2=string(ypos)
  4076. modify("temp.width='"+string(long(io[iio].ox2) -long(io[iio].ox1))+"'")
  4077. modify("temp.height='"+string(long(io[iio].oy2) -long(io[iio].oy1))+"'")
  4078. ii_x=xpos
  4079. ii_y=ypos
  4080. else
  4081. event ue_lbuttonup(xpos,ypos,row,dwo)
  4082. end if
  4083. end if
  4084. elseif iio>0 then //单个对象选择
  4085. i=iio
  4086. choose case io[i].otype
  4087. case 'line'
  4088. choose case is_point
  4089. case "mouseup"
  4090. choose case left(io[i].oname,5)
  4091. case 'line1'
  4092. if (xpos>=long(io[i].ox1) and xpos<=long(io[i].ox1)+2 and ypos>=long(io[i].oy1) - 2 and ypos<=long(io[i].oy1)+2) or &
  4093. (xpos>=long(io[i].ox2) - 2 and xpos<=long(io[i].ox2) and ypos>=long(io[i].oy2) - 2 and ypos<=long(io[i].oy2)+2) then
  4094. modify(io[i].oname+".pointer='cross!'")
  4095. else
  4096. modify(io[i].oname+".pointer='arrow!'")
  4097. end if
  4098. case 'line2'
  4099. if (xpos>=long(io[i].ox1) - 2 and xpos<=long(io[i].ox1)+2 and ypos>=long(io[i].oy1) and ypos<=long(io[i].oy1)+2) or &
  4100. (xpos>=long(io[i].ox2) - 2 and xpos<=long(io[i].ox2)+2 and ypos>=long(io[i].oy2) - 2 and ypos<=long(io[i].oy2)) then
  4101. modify(io[i].oname+".pointer='cross!'")
  4102. if isvalid(dwo) then
  4103. if dwo.name<>'datawindow' then //对于短竖线,光标需要特殊处理
  4104. iso_old=dwo.name
  4105. dwo.pointer='cross!'
  4106. is_click_object='y'
  4107. modify(iso_old+".pointer='cross!'")
  4108. end if
  4109. end if
  4110. else
  4111. modify(io[i].oname+".pointer='arrow!'")
  4112. if iso_old>'' then
  4113. modify(iso_old+".pointer='arrow!'")
  4114. end if
  4115. is_click_object='n'
  4116. end if
  4117. case else//'line3'
  4118. if (xpos>=long(io[i].ox1) - 2 and xpos<=long(io[i].ox1)+2 and ypos>=long(io[i].oy1) - 2 and ypos<=long(io[i].oy1)+2) or &
  4119. (xpos>=long(io[i].ox2) - 2 and xpos<=long(io[i].ox2)+2 and ypos>=long(io[i].oy2) - 2 and ypos<=long(io[i].oy2)+2) then
  4120. modify(io[i].oname+".pointer='cross!'")
  4121. else
  4122. modify(io[i].oname+".pointer='arrow!'")
  4123. end if
  4124. end choose
  4125. case "point1"
  4126. choose case left(io[i].oname,5)
  4127. case 'line1'
  4128. io[i].ox1=string(long(io[i].ox1)+xpos - ii_x)
  4129. if (ypos>=long(io[i].oy1) - 2 and ypos<=long(io[i].oy1)+2) then
  4130. modify(io[i].oname+".pointer='cross!'")
  4131. else
  4132. modify(io[i].oname+".pointer='arrow!'")
  4133. end if
  4134. case 'line2'
  4135. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4136. if (xpos>=long(io[i].ox1) - 2 and xpos<=long(io[i].ox1)+2) then
  4137. modify(io[i].oname+".pointer='cross!'")
  4138. else
  4139. modify(io[i].oname+".pointer='arrow!'")
  4140. end if
  4141. case else//'line3'
  4142. io[i].ox1=string(long(io[i].ox1)+xpos - ii_x)
  4143. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4144. end choose
  4145. ii_x=xpos
  4146. ii_y=ypos
  4147. case "point2"
  4148. choose case left(io[i].oname,5)
  4149. case 'line1'
  4150. io[i].ox2=string(long(io[i].ox2)+xpos - ii_x)
  4151. if (ypos>=long(io[i].oy2) - 2 and ypos<=long(io[i].oy2)+2) then
  4152. modify(io[i].oname+".pointer='cross!'")
  4153. else
  4154. modify(io[i].oname+".pointer='arrow!'")
  4155. end if
  4156. case 'line2'
  4157. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4158. if (xpos>=long(io[i].ox2) - 2 and xpos<=long(io[i].ox2)+2) then
  4159. modify(io[i].oname+".pointer='cross!'")
  4160. else
  4161. modify(io[i].oname+".pointer='arrow!'")
  4162. end if
  4163. case else//'line3'
  4164. io[i].ox2=string(long(io[i].ox2)+xpos - ii_x)
  4165. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4166. end choose
  4167. ii_x=xpos
  4168. ii_y=ypos
  4169. case "move"
  4170. if keydown(KeyLeftButton!) then
  4171. io[i].ox1=string(long(io[i].ox1)+xpos - ii_x)
  4172. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4173. io[i].ox2=string(long(io[i].ox2)+xpos - ii_x)
  4174. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4175. ii_x=xpos
  4176. ii_y=ypos
  4177. end if
  4178. end choose
  4179. if keydown(KeyLeftButton!) then
  4180. wf_object(i,1)
  4181. end if
  4182. case 'text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  4183. choose case is_point
  4184. case 'move'
  4185. if keydown(KeyLeftButton!) then
  4186. io[i].ox1=string(long(io[i].ox1)+xpos - ii_x)
  4187. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4188. io[i].ox2=string(long(io[i].ox2)+xpos - ii_x)
  4189. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4190. wf_object(i,1)
  4191. ii_x=xpos
  4192. ii_y=ypos
  4193. end if
  4194. case 'upline'
  4195. if long(io[i].oy2) - long(io[i].oy1) - ypos+ii_y>=2 then
  4196. io[i].oy1=string(long(io[i].oy1)+ypos - ii_y)
  4197. wf_object(i,1)
  4198. ii_x=xpos
  4199. ii_y=ypos
  4200. end if
  4201. case 'downline'
  4202. if long(io[i].oy2) - long(io[i].oy1)+ypos - ii_y>=2 then
  4203. io[i].oy2=string(long(io[i].oy2)+ypos - ii_y)
  4204. wf_object(i,1)
  4205. ii_x=xpos
  4206. ii_y=ypos
  4207. end if
  4208. case 'leftline'
  4209. if long(io[i].ox2) - long(io[i].ox1) - xpos+ii_x>=2 then
  4210. io[i].ox1=string(long(io[i].ox1)+xpos - ii_x)
  4211. wf_object(i,1)
  4212. ii_x=xpos
  4213. ii_y=ypos
  4214. end if
  4215. case 'rightline'
  4216. if long(io[i].ox2) - long(io[i].ox1)+xpos - ii_x>=2 then
  4217. io[i].ox2=string(long(io[i].ox2)+xpos - ii_x)
  4218. wf_object(i,1)
  4219. ii_x=xpos
  4220. ii_y=ypos
  4221. end if
  4222. case 'lbuttonup'
  4223. is_point='mouseup'
  4224. case 'mouseup'
  4225. if (xpos>=long(io[i].ox1) and xpos<=long(io[i].ox1)+2 and ypos>=long(io[i].oy1) and ypos<=long(io[i].oy2)) or &
  4226. (xpos>=long(io[i].ox2) - 2 and xpos<=long(io[i].ox2) and ypos>=long(io[i].oy1) and ypos<=long(io[i].oy2)) then
  4227. if pos(describe(io[i].oname+".pointer"),'sizewe!')=0 then
  4228. modify(io[i].oname+".pointer='sizewe!'")
  4229. end if
  4230. elseif (xpos>=long(io[i].ox1) and xpos<=long(io[i].ox2) and ypos>=long(io[i].oy1) and ypos<=long(io[i].oy1)+2 ) or &
  4231. (xpos>=long(io[i].ox1) and xpos<=long(io[i].ox2) and ypos>=long(io[i].oy2) - 2 and ypos<=long(io[i].oy2)) then
  4232. if pos(describe(io[i].oname+".pointer"),'sizens!')=0 then
  4233. modify(io[i].oname+".pointer='sizens!'")
  4234. end if
  4235. else
  4236. if pos(describe(io[i].oname+".pointer"),'arrow!')=0 then
  4237. modify(io[i].oname+".pointer='arrow!'")
  4238. end if
  4239. end if
  4240. end choose
  4241. case 'band'
  4242. if is_point='move' then
  4243. if keydown(KeyLeftButton!) then
  4244. if long(io[i].oy1)+ypos - ii_y>ii_topformove+2 then
  4245. wf_aftermove(ypos - ii_y,1)
  4246. else
  4247. wf_aftermove(ii_topformove+2 - long(io[i].oy1),1)
  4248. end if
  4249. ii_x=xpos
  4250. ii_y=ypos
  4251. end if
  4252. end if
  4253. case 'temp'
  4254. if keydown(KeyLeftButton!) then
  4255. io[i].ox2=string(xpos)
  4256. io[i].oy2=string(ypos)
  4257. wf_object(i,1)
  4258. ii_x=xpos
  4259. ii_y=ypos
  4260. else
  4261. event ue_lbuttonup(xpos,ypos,row,dwo)
  4262. end if
  4263. case 'sep1'
  4264. if keydown(KeyLeftButton!) then
  4265. io[i].ox2=string(xpos)
  4266. wf_object(i,1)
  4267. ii_x=xpos
  4268. ii_y=ypos
  4269. else
  4270. event ue_lbuttonup(xpos,ypos,row,dwo)
  4271. end if
  4272. end choose
  4273. end if
  4274. SetRedraw(true)
  4275. ii_x_old=xpos
  4276. ii_y_old=ypos
  4277. end if
  4278. return
  4279. end event
  4280. event doubleclicked;if is_toolbar>'' then return
  4281. //if ii_save>0 then wf_write()//为了计算字段直接引用前一个计算字段名,但可能会有点影响速度
  4282. //wf_write()//为了计算字段直接引用前一个计算字段名,但可能会有点影响速度
  4283. if pos(dwo.name,ibackgroudname) = 1 AND cbx_lock.checked then return
  4284. if iic=0 then//没有选择任何对象
  4285. iio=iis+1
  4286. io[iio]=id[1]
  4287. openwithparm(w_rpt_edit,istr_rpt,parent)
  4288. id[1]=io[iio]
  4289. io[iio]=id[2]//清空最后一行
  4290. iio=0
  4291. else
  4292. openwithparm(w_rpt_edit,istr_rpt,parent)
  4293. if pos(io[iio].oname,'band_g_')=1 then//分组表达式
  4294. iso=io[iio].oname
  4295. if pos(iso,'band_g_h')=1 then
  4296. iso=f_replace(iso,'band_g_h_','band_g_b_')
  4297. else
  4298. iso=f_replace(iso,'band_g_b_','band_g_h_')
  4299. end if
  4300. i=wf_afind()
  4301. io[i].obcolor=io[iio].obcolor//newpage
  4302. io[i].ofname=io[iio].ofname//resetpagecount
  4303. io[i].otext=io[iio].otext//text
  4304. io[i].ofsize=io[iio].ofsize//group by
  4305. wf_object(i,1)
  4306. iso=io[iio].oname
  4307. end if
  4308. end if
  4309. is_point='mouseup'
  4310. end event
  4311. event scrollvertical;ii_y_scroll=scrollpos
  4312. dwy.event ScrollVertical(ii_y_scroll)
  4313. dwy.object.DataWindow.VerticalScrollPosition=string(ii_y_scroll)
  4314. return 0
  4315. end event
  4316. event scrollhorizontal;ii_x_scroll=scrollpos
  4317. dwx.event ScrollHorizontal(ii_x_scroll,1)
  4318. dwx.object.DataWindow.HorizontalScrollPosition=string(ii_x_scroll)
  4319. return 0
  4320. end event
  4321. event clicked;dwc2.event ue_close()
  4322. xpos=xpos+ii_x_scroll
  4323. ypos=ypos+ii_y_scroll
  4324. ii_x=xpos
  4325. ii_y=ypos
  4326. if not isvalid(dwo) then return
  4327. if is_toolbar='' then
  4328. if keydown(KeyShift!) or keydown(keyControl!) then//按下ctrl,选择多个对象
  4329. iso=dwo.name
  4330. if pos(iso,ibackgroudname) = 1 AND cbx_lock.checked then iso = 'datawindow'
  4331. iio=wf_afind()
  4332. if iio>0 then
  4333. if io[iio].oselect<'1' then
  4334. iic++
  4335. io[iio].oselect=string(iic)
  4336. else
  4337. for i=1 to iis
  4338. if long(io[i].oselect)>long(io[iio].oselect) then
  4339. io[i].oselect=string(long(io[i].oselect) -1)
  4340. end if
  4341. next
  4342. iic --
  4343. io[iio].oselect=''
  4344. end if
  4345. elseif iso='datawindow' then
  4346. goto mytemp
  4347. end if
  4348. is_point='select'
  4349. else //只按下CLICK,没按下ctrl
  4350. if iic>1 then //已选了多个对象
  4351. iso=dwo.name
  4352. if pos(iso,ibackgroudname) = 1 AND cbx_lock.checked then iso = 'datawindow'
  4353. iio=wf_afind()
  4354. if iio>0 then
  4355. if io[iio].oselect>'0' then
  4356. is_point='move'
  4357. else
  4358. is_point='changeto_one'
  4359. parent.event ue_sel_no()
  4360. iic=1
  4361. io[iio].oselect='1'
  4362. end if
  4363. else
  4364. is_point='changeto_one'
  4365. parent.event ue_sel_no()
  4366. if iso='datawindow' then
  4367. wf_setcolor()
  4368. goto mytemp
  4369. end if
  4370. end if
  4371. else //只选了单个对象
  4372. if is_click_object<>'y' then
  4373. iso=dwo.name
  4374. if pos(iso,ibackgroudname) = 1 AND cbx_lock.checked then iso = 'datawindow'
  4375. end if
  4376. iio=wf_afind()
  4377. if iio>0 then
  4378. if iic>0 then
  4379. parent.event ue_sel_no()
  4380. end if
  4381. iic=1
  4382. io[iio].oselect='1'
  4383. if io[iio].otype='band' then
  4384. ii_topformove=wf_topformove()
  4385. end if
  4386. elseif iso='datawindow' then
  4387. if iic>0 then
  4388. parent.event ue_sel_no()
  4389. wf_setcolor()
  4390. end if
  4391. goto mytemp
  4392. end if
  4393. is_type=io[iio].otype
  4394. choose case io[iio].otype
  4395. case 'line'
  4396. choose case left(iso,5)
  4397. case 'line1'
  4398. if (xpos>=long(io[iio].ox1) and xpos<=long(io[iio].ox1)+2 and ypos>=long(io[iio].oy1) - 2 and ypos<=long(io[iio].oy1)+2) then
  4399. is_point='point1'
  4400. elseif (xpos>=long(io[iio].ox2) - 2 and xpos<=long(io[iio].ox2) and ypos>=long(io[iio].oy2) - 2 and ypos<=long(io[iio].oy2)+2) then
  4401. is_point='point2'
  4402. else
  4403. is_point='move'
  4404. end if
  4405. case 'line2'
  4406. if (xpos>=long(io[iio].ox1) - 2 and xpos<=long(io[iio].ox1)+2 and ypos>=long(io[iio].oy1) and ypos<=long(io[iio].oy1)+2) then
  4407. is_point='point1'
  4408. elseif (xpos>=long(io[iio].ox2) - 2 and xpos<=long(io[iio].ox2)+2 and ypos>=long(io[iio].oy2) - 2 and ypos<=long(io[iio].oy2)) then
  4409. is_point='point2'
  4410. else
  4411. is_point='move'
  4412. end if
  4413. case else//'line3'
  4414. if (xpos>=long(io[iio].ox1) - 2 and xpos<=long(io[iio].ox1)+2 and ypos>=long(io[iio].oy1) - 2 and ypos<=long(io[iio].oy1)+2) then
  4415. is_point='point1'
  4416. elseif (xpos>=long(io[iio].ox2) - 2 and xpos<=long(io[iio].ox2)+2 and ypos>=long(io[iio].oy2) - 2 and ypos<=long(io[iio].oy2)+2) then
  4417. is_point='point2'
  4418. else
  4419. is_point='move'
  4420. end if
  4421. end choose
  4422. case 'text','column','compute','rectangle','bitmap','graph','tableblob','report','button','groupbox','ellipse','roundrectangle'
  4423. if (xpos>=long(io[iio].ox1) and xpos<=long(io[iio].ox1)+2 and ypos>=long(io[iio].oy1) and ypos<=long(io[iio].oy2)) then
  4424. is_point='leftline'
  4425. elseif (xpos>=long(io[iio].ox2) - 2 and xpos<=long(io[iio].ox2) and ypos>=long(io[iio].oy1) and ypos<=long(io[iio].oy2)) then
  4426. is_point='rightline'
  4427. elseif (xpos>=long(io[iio].ox1) and xpos<=long(io[iio].ox2) and ypos>=long(io[iio].oy1) and ypos<=long(io[iio].oy1)+2 ) then
  4428. is_point='upline'
  4429. elseif (xpos>=long(io[iio].ox1) and xpos<=long(io[iio].ox2) and ypos>=long(io[iio].oy2) - 2 and ypos<=long(io[iio].oy2)) then
  4430. is_point='downline'
  4431. else
  4432. is_point='move'
  4433. end if
  4434. case 'band'
  4435. is_point='move'
  4436. case else
  4437. parent.event ue_sel_no()
  4438. end choose
  4439. end if
  4440. end if
  4441. wf_setcolor()
  4442. else//第一次创建对象
  4443. if is_toolbar='sep1' then
  4444. iio=iis+2
  4445. elseif is_toolbar='taborder' then
  4446. iso=dwo.name
  4447. if right(iso,5)='_zkl0' then
  4448. dw1.setitem(1,1,long(dwo.text))
  4449. if dw1.describe('zkl0.x')='?' then
  4450. s[1]="create column(band=detail name=zkl0 id=1 x='"+dwo.x+"' y='"+dwo.y+"' tabsequence=1 edit.limit=0 edit.case=any edit.autoselect=yes width='24' height='12' font.face='宋体' font.height='12' alignment='1' border='0' color='16777215' background.color='255')"
  4451. else
  4452. s[1]="zkl0.x='"+dwo.x+"' zkl0.y='"+dwo.y+"')"
  4453. end if
  4454. dw1.modify(s[1])
  4455. dw1.setcolumn(1)
  4456. dw1.setredraw(true)
  4457. end if
  4458. return
  4459. else
  4460. ii_temp=0//求最大对象名
  4461. for i=1 to iis
  4462. if pos(io[i].oname,is_toolbar)>0 then
  4463. ii_temp=max(ii_temp,long(mid(io[i].oname,len(is_toolbar)+2)))
  4464. end if
  4465. next
  4466. iis++
  4467. iio=iis
  4468. io[iio].oname=is_toolbar+'_'+string(ii_temp+1)
  4469. io[iio].occ=wf_occ(1)+1
  4470. iic=1
  4471. io[iio].oselect='1'
  4472. end if
  4473. i=iio
  4474. io[i].ox1=string(xpos)
  4475. io[i].oy1=string(ypos)
  4476. choose case is_toolbar
  4477. case 'line1','line2','line3'
  4478. choose case is_toolbar
  4479. case 'line1'
  4480. io[i].ox2=string(xpos+50)
  4481. io[i].oy2=string(ypos)
  4482. case 'line2'
  4483. io[i].ox2=string(xpos)
  4484. io[i].oy2=string(ypos+50)
  4485. case 'line3'
  4486. io[i].ox2=string(xpos+30)
  4487. io[i].oy2=string(ypos+30)
  4488. end choose
  4489. io[i].oborder='0'
  4490. io[i].otext='1'
  4491. io[i].ocolor='0'
  4492. io[i].obcolor='16777215'
  4493. io[i].otype='line'
  4494. case 'text'
  4495. io[i].ox2=string(long(io[i].ox1)+40)
  4496. io[i].oy2=string(long(io[i].oy1)+12)
  4497. io[i].otext=f_replace(io[i].oname,is_toolbar+'_',"文本")
  4498. io[i].oborder='0'
  4499. io[i].ocolor='0'
  4500. io[i].obcolor='536870912'//'16777215'
  4501. io[i].ofname='宋体'
  4502. io[i].ofsize='12'
  4503. io[i].oalignment='0'
  4504. io[i].otype=is_toolbar
  4505. case 'groupbox'
  4506. io[i].ox2=string(long(io[i].ox1)+80)
  4507. io[i].oy2=string(long(io[i].oy1)+40)
  4508. io[i].otext=f_replace(io[i].oname,is_toolbar+'_',"分组框")
  4509. io[i].oborder='5'
  4510. io[i].ocolor='0'
  4511. io[i].obcolor='536870912'
  4512. io[i].ofname='宋体'
  4513. io[i].ofsize='12'
  4514. io[i].oalignment='0'
  4515. io[i].otype=is_toolbar
  4516. case 'button'
  4517. io[i].ox2=string(long(io[i].ox1)+56)
  4518. io[i].oy2=string(long(io[i].oy1)+16)
  4519. io[i].otext=f_replace(io[i].oname,is_toolbar+'_',"按钮")
  4520. io[i].oborder='0'
  4521. io[i].ocolor='0'
  4522. io[i].obcolor='80269524'
  4523. io[i].ofname='宋体'
  4524. io[i].ofsize='12'
  4525. io[i].otype='button'
  4526. case 'compute'
  4527. io[i].ox2=string(long(io[i].ox1)+56)
  4528. io[i].oy2=string(long(io[i].oy1)+12)
  4529. io[i].otext="'"+f_replace(io[i].oname,is_toolbar+'_','表达式')+"'"
  4530. io[i].oborder='0'
  4531. io[i].ocolor='0'
  4532. io[i].obcolor='16777215'
  4533. io[i].ofname='宋体'
  4534. io[i].ofsize='12'
  4535. io[i].oalignment='0'
  4536. io[i].oexpression=io[i].otext
  4537. io[i].otype='compute'
  4538. case 'rectangle','roundrectangle','ellipse'
  4539. io[i].ox2=string(long(io[i].ox1)+40)
  4540. io[i].oy2=string(long(io[i].oy1)+20)
  4541. io[i].oborder='0'
  4542. io[i].otext='1'
  4543. io[i].ocolor='0'
  4544. io[i].obcolor='16777215'
  4545. io[i].ofname='16777215'//brush.color
  4546. io[i].ofsize='6'//brush.hatch
  4547. if is_toolbar='roundrectangle' then
  4548. io[i].ofweight='10'
  4549. io[i].ofitalic='10'
  4550. end if
  4551. io[i].otype=is_toolbar
  4552. case 'sep1' //垂直分割
  4553. io[i].ox1=string(xpos)
  4554. io[i].oname='sep1'
  4555. io[i].otype='sep1'
  4556. case 'bitmap'
  4557. STRING FileType
  4558. FileType += "JPG(*.JPG),*.JPG,"
  4559. FileType += "位图文件(*.bmp),*.bmp,"
  4560. FileType += "GIF文件(*.GIF),*.GIF"
  4561. if GetFileOpenName("Select File",io[i].otext,is_temp,"all",FileType)=1 then
  4562. // if GetFileOpenName("Select File",io[i].otext,is_temp,"bmp","Bitmap Files(*.BMP),*.bmp")=1 then
  4563. io[i].ox2=string(long(io[i].ox1)+40)
  4564. io[i].oy2=string(long(io[i].oy1)+40)
  4565. io[i].oborder='2'
  4566. else
  4567. iis --
  4568. iio=0
  4569. iic=0
  4570. return
  4571. end if
  4572. io[i].otype='bitmap'
  4573. case 'tableblob'
  4574. io[i].ox2=string(long(io[i].ox1)+80)
  4575. io[i].oy2=string(long(io[i].oy1)+40)
  4576. io[i].oborder='0'
  4577. io[i].otext=io[i].oname
  4578. io[i].ofname=io[i].oname
  4579. io[i].ofsize='PBrush'
  4580. io[i].otype='tableblob'
  4581. case 'report'
  4582. io[i].ox2=string(long(io[i].ox1)+400)
  4583. io[i].oy2=string(long(io[i].oy1)+40)
  4584. io[i].oborder='0'
  4585. io[i].otext=io[i].oname
  4586. io[i].otype='report'
  4587. io[i].obcolor='yes'//height.autosize
  4588. case 'graph'
  4589. io[i].ox2=string(long(io[i].ox1)+240)
  4590. io[i].oy2=string(long(io[i].oy1)+160)
  4591. io[i].oborder='0'
  4592. io[i].otext=f_replace(io[i].oname,is_toolbar+'_','统计图')//gtitle
  4593. io[i].ocolor='0'//color
  4594. io[i].obcolor='16777215'//backcolor
  4595. io[i].ofname='7'//graphtype
  4596. io[i].ofsize=''//gfl
  4597. io[i].ofweight='分类轴'//gtfl
  4598. io[i].ofitalic=''//gvalue
  4599. io[i].ofunderline='数据轴'//gtvalue
  4600. io[i].otype='graph'
  4601. io[i].others="{title.dispattr.backcolor=553648127}{legend.dispattr.backcolor=536870912}{series.dispattr.backcolor=536870912}{series.labeldispattr.backcolor=536870912}{category.dispattr.backcolor=536870912}{category.labeldispattr.backcolor=536870912}{values.dispattr.backcolor=536870912}{values.labeldispattr.backcolor=536870912}{title.dispattr.alignment=2}{title.dispattr.font.weight=700}{series.labeldispattr.alignment=2}{category.labeldispattr.alignment=2}{values.labeldispattr.alignment=2}{values.labeldispattr.font.escapement=900}{values.labeldispattr.font.height=12}"
  4602. end choose
  4603. wf_object(i,0)
  4604. wf_setcolor()
  4605. choose case is_toolbar
  4606. case 'line1'
  4607. parent.event ue_toolbar('line1',m_rpt_main.m_1.m_line1)
  4608. case 'line2'
  4609. parent.event ue_toolbar('line2',m_rpt_main.m_1.m_line2)
  4610. case 'line3'
  4611. parent.event ue_toolbar('line3',m_rpt_main.m_1.m_line3)
  4612. case 'text'
  4613. parent.event ue_toolbar('text',m_rpt_main.m_1.m_text)
  4614. case 'compute'
  4615. parent.event ue_toolbar('compute',m_rpt_main.m_1.m_edit)
  4616. case 'rectangle'
  4617. parent.event ue_toolbar('rectangle',m_rpt_main.m_1.m_rect)
  4618. case 'bitmap'
  4619. parent.event ue_toolbar('bitmap',m_rpt_main.m_1.m_pict)
  4620. case 'tableblob'
  4621. parent.event ue_toolbar('tableblob',m_rpt_main.m_1.m_blob)
  4622. case 'report'
  4623. parent.event ue_toolbar('report',m_rpt_main.m_1.m_rpt)
  4624. case 'graph'
  4625. parent.event ue_toolbar('graph',m_rpt_main.m_1.m_graph)
  4626. case 'button'
  4627. parent.event ue_toolbar('button',m_rpt_main.m_1.m_button)
  4628. case 'groupbox'
  4629. parent.event ue_toolbar('groupbox',m_rpt_main.m_1.m_groupbox)
  4630. case 'ellipse'
  4631. parent.event ue_toolbar('ellipse',m_rpt_main.m_1.m_ellipse)
  4632. case 'roundrectangle'
  4633. parent.event ue_toolbar('roundrectangle',m_rpt_main.m_1.m_roundrectangle)
  4634. end choose
  4635. if is_toolbar<>'sep1' then is_toolbar=''
  4636. end if
  4637. return
  4638. mytemp:
  4639. iso='temp'
  4640. iio=iis+1
  4641. io[iio].otype='temp'
  4642. io[iio].oname='temp'
  4643. io[iio].ox1=string(xpos)
  4644. io[iio].oy1=string(ypos)
  4645. io[iio].ox2=io[iio].ox1
  4646. io[iio].oy2=io[iio].oy1
  4647. wf_object(iio,0)
  4648. return
  4649. end event
  4650. event rbuttondown;//右鼠标按下时触发事件
  4651. EVENT Clicked(xpos,ypos,row,dwo)
  4652. IF io[iio].otype = 'report' THEN
  4653. m_rpt_pop_report m_pop1
  4654. m_pop1 = CREATE m_rpt_pop_report
  4655. IF id[1].ox1 <> '4' OR iic > 0 THEN //<>crosstab
  4656. m_pop1.m_popup.m_cross.Visible = FALSE
  4657. END IF
  4658. m_rpt_pop_report.m_popup.PopMenu(PARENT.PointerX(),PARENT.PointerY())
  4659. ELSE
  4660. m_rpt_pop m_pop
  4661. m_pop = CREATE m_rpt_pop
  4662. IF id[1].ox1 <> '4' OR iic > 0 THEN //<>crosstab
  4663. m_pop.m_popup.m_cross.Visible = FALSE
  4664. END IF
  4665. m_rpt_pop.m_popup.PopMenu(PARENT.PointerX(),PARENT.PointerY())
  4666. END IF
  4667. EVENT ue_lbuttonup(xpos,ypos,row,dwo)
  4668. end event
  4669. event other;if (iso='temp' or is_point='move') and ii_outside=0 then//iso='temp'表示选择多个对象,is_point='move'表示正在拖动对象,ii_outside=0表示上次触发的ue_outside事件已经结束
  4670. if PointerX()>width -68 then//右边界
  4671. ii_outside=1
  4672. parent.postevent('ue_outside')//只能用postevent
  4673. elseif PointerY()>height -68 then//下边界
  4674. ii_outside=2
  4675. parent.postevent('ue_outside')
  4676. end if
  4677. end if
  4678. end event
  4679. event editchanged;if right(iso,5)='_zkl0' then//taborder
  4680. dw1.modify(iso+".text='"+data+"'")
  4681. ii_save=1
  4682. end if
  4683. end event
  4684. type dwc2 from uo_scolor within w_rpt_main
  4685. boolean visible = false
  4686. integer x = 1911
  4687. integer y = 100
  4688. integer taborder = 20
  4689. boolean bringtotop = true
  4690. end type
  4691. event ue_close;call super::ue_close;choose case is_scolor
  4692. case 'bjst'
  4693. dwc1.object.bjs.background.color=is_color
  4694. wf_allset('bcolor',is_color)
  4695. case 'qjst'
  4696. dwc1.object.qjs.background.color=is_color
  4697. wf_allset('color',is_color)
  4698. end choose
  4699. dwc1.object.qjst.border='0'
  4700. dwc1.object.bjst.border='0'
  4701. dwc1.object.t.border='0'
  4702. dwc1.object.b.border='0'
  4703. is_scolor=''
  4704. end event
  4705. type cbx_lock from checkbox within w_rpt_main
  4706. integer x = 3397
  4707. integer y = 116
  4708. integer width = 315
  4709. integer height = 60
  4710. boolean bringtotop = true
  4711. integer textsize = -9
  4712. integer weight = 400
  4713. fontcharset fontcharset = gb2312charset!
  4714. fontpitch fontpitch = variable!
  4715. string facename = "宋体"
  4716. long backcolor = 80269524
  4717. boolean enabled = false
  4718. string text = "锁定背景"
  4719. end type
  4720. event clicked;cb_setbackgroud.Enabled = Not This.checked
  4721. end event