123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 |
- $PBExportHeader$uo_rpt_print_preview.sru
- forward
- global type uo_rpt_print_preview from nonvisualobject
- end type
- end forward
- global type uo_rpt_print_preview from nonvisualobject autoinstantiate
- end type
- type prototypes
- function boolean IsWindowsNT() library "PrintCtrl.dll"
- SUBROUTINE About() library "PrintCtrl.dll"
- function boolean GetDefaultPrinter(ref string PrinterName, int BufferLen) library "PrintCtrl.dll" alias for "GetDefaultPrinter;Ansi"
- function boolean GetPrinterPort(ref string PrinterName, ref string Port, int PortLen, ref string Driver, int DriverLen) library "PrintCtrl.dll" alias for "GetPrinterPort;Ansi"
- function boolean GetPrinterList(ref string PrinterList, ref long bufferLen) library "PrintCtrl.dll" alias for "GetPrinterList;Ansi"
- function boolean GetPrinterStatus(ref string Printer, ref long status) library "PrintCtrl.dll" alias for "GetPrinterStatus;Ansi"
- function boolean GetPaperList(ref string Printer, ref string PaperList, ref long bufferLen) library "PrintCtrl.dll" alias for "GetPaperList;Ansi"
- function boolean SetPrinterDefault(ref string Printer) library "PrintCtrl.dll" alias for "SetPrinterDefault;Ansi"
- function boolean AddCustomPaper( ref string Printer, ref string PaperName, long pwidth, long pheight, long left, long right, long top, long bottom) library "PrintCtrl.dll" alias for "AddCustomPaper;Ansi"
- function boolean DeleteCustomPaper(ref string Printer, ref string PaperName) library "PrintCtrl.dll" alias for "DeleteCustomPaper;Ansi"
- function boolean SetUserDefinePaper(ref string Printer, ref long pWidth, ref long pHeight) library "PrintCtrl.dll" alias for "SetUserDefinePaper;Ansi"
- function boolean GetUserDefinePaperMinMax(ref string Printer, ref long minWidth, ref long minHeight, ref long maxWidth, ref long maxHeight) library "PrintCtrl.dll" alias for "GetUserDefinePaperMinMax;Ansi"
- function boolean GetDefaultPaper(ref string Printer, ref string PaperName, ref int nOrientation) library "PrintCtrl.dll" alias for "GetDefaultPaper;Ansi"
- function boolean SetDefaultPaper(ref string Printer, ref string PaperName, int nOrientation) library "PrintCtrl.dll" alias for "SetDefaultPaper;Ansi"
- function boolean GetDefaultPaper(ref string Printer, ref string PaperName,ref long nPapserSize, ref long nOrientation) library "PrintCtrl.dll" alias for "GetDefaultPaper;Ansi"
- function boolean GetPaperName(ref string Printer, ref string PaperName, int PaperSize) library "PrintCtrl.dll" alias for "GetPaperName;Ansi"
- function boolean GetPaperSize(ref string Printer, ref string PaperName, ref int PaperSize) library "PrintCtrl.dll" alias for "GetPaperSize;Ansi"
- function boolean GetBinNameList(ref string Printer, ref string BinNameList) library "PrintCtrl.dll" alias for "GetBinNameList;Ansi"
- function boolean GetBin(ref string Printer, ref string BinName, ref int Bin) library "PrintCtrl.dll" alias for "GetBin;Ansi"
- function boolean GetBinName(ref string Printer, ref string BinName, int Bin) library "PrintCtrl.dll" alias for "GetBinName;Ansi"
- end prototypes
- type variables
- S_rpt_print_MSG FACT_PRINT_MSG
- string dwdataobject
- DataWindowChild ins_dwcld
- s_childreportxwidth s_xwidth
- dwobject dwod
- long retrieveid=0,secondretrieveid=0,scid=0
- uo_printer_setting lnv_printer
- String ins_printerlist [ ]
- int p_printerlist =0
- string dw_default_printer ='',default_printer =''
- string default_printer_info=''
- LONG Print_row
- string default_dwname,default_dname
- datastore ds_print
- string rpt_inifilename = 'longjoeERP_rpt.ini'
- long reportid
- end variables
- forward prototypes
- public subroutine uof_initprinterinfo ()
- public function integer uof_trycreate_sys_dwnsyntax (ref string arg_msg)
- public function integer uof_print_begin (ref string arg_msg)
- public function integer uof_defdataobject (ref string arg_msg)
- public function integer uof_dwcreate (string arg_dwname, string arg_formatname, ref string arg_msg)
- public function integer ds_retrieve ()
- public function integer uof_read_subdwpos (string arg_dwname, string arg_dname, ref s_childreportxwidth s_subdwwidth, ref string arg_msg)
- public subroutine uof_subdwpos_blobtostru (blob arg_blob, ref s_childreportxwidth arg_s_xwidth)
- public function integer uof_mdfmxreport (s_childreportxwidth s_xw)
- public function integer uof_mdfx (s_childreportxwidth s_xw, integer pt)
- public subroutine ds_print ()
- public subroutine uof_nullrow (long arg_rowcnt, long arg_pagerow, ref long arg_nullrow)
- end prototypes
- public subroutine uof_initprinterinfo ();// 取PB缺省打印机
- String printerName
- Boolean rt_1
- printerName = Space(255)
- rt_1 = GetDefaultPrinter(REF printerName, 255)
- IF rt_1 THEN
- default_printer = Trim(printerName)
- ELSE
- default_printer = ''
- END IF
- //取PB缺省打印机设置字符串
- default_printer_info = ProfileString ( "win.ini", "windows", "device", "" )
- end subroutine
- public function integer uof_trycreate_sys_dwnsyntax (ref string arg_msg);//wf_trycreate_sys_dwnsyntax
- long rslt=1
- long cnt
- string createsql_string,t_str
- createsql_string="CREATE TABLE sys_dwnSyntax ( dwname char (50) NOT NULL,dname char (50) NOT NULL,default_flag tinyint not null default (0),dwSyntaxB image not NULL DEFAULT (''),subdwSyntaxB image not NULL DEFAULT ('')) "+&
- " ~n ALTER TABLE sys_dwnSyntax WITH NOCHECK ADD CONSTRAINT PK_sys_dwnSyntax PRIMARY KEY CLUSTERED (dwname,dname)"
- t_str="select count(*) from sys_dwnSyntax"
- Execute immediate :t_str;
- if sqlca.sqlcode=0 then //已经存在该表
- rslt=1
- goto ext
- end if
- Execute immediate :createsql_string ;
-
- if sqlca.sqlcode<>0 then
- arg_msg='建立表sys_dwnSyntax失败>>'+sqlca.sqlerrtext
- rollback ;
- rslt=0
- goto ext
- end if
- commit ;
- ext:
- return rslt
- return 0
- end function
- public function integer uof_print_begin (ref string arg_msg);int rslt=1
- string ls_dw
- Blob lblob
- //------------------初始化打印机
- uof_initprinterinfo()
- retrieveid=fact_print_msg.retr_pramnmb
- scid=fact_print_msg.retr_scid
- reportid = fact_print_msg.rpid
- //********************
- //获取DW数据
- SELECTBLOB Rpsyntax INTO :lblob FROM u_report_list Where rpid = :reportid USING sqlca;
- IF sqlca.SQLCode = 0 THEN
- ls_dw = String(lblob)
- END IF
- ds_print.Create(ls_dw,arg_msg)
- IF arg_msg > '' THEN
- rslt = 0
- goto ext
- END IF
- ds_print.SetTransObject(SQLCA)
- dw_default_printer = f_ProfileString (sys_empid,string(reportid), "dw_default_printer ", "" )
- IF dw_default_printer = '' THEN
- dw_default_printer = default_printer
- END IF
- string ls_parm
- ls_parm = string(reportid) + '_' + dw_default_printer
- //------------------读默认行数
- fact_print_msg.printrow=long(f_ProfileString (sys_empid,ds_print.dataobject, "printrow", '10'))
- IF NOT ISNULL(fact_print_msg.ini_GROUP) THEN
- ds_print.OBJECT.DataWindow.PRINT.MARGIN.TOP=INTEGER(f_ProfileString (sys_empid,ls_parm, "MARGIN_TOP", "30"))
- ds_print.OBJECT.DataWindow.PRINT.MARGIN.LEFT=INTEGER(f_ProfileString (sys_empid,ls_parm, "MARGIN_LEFT", "30" ))
- ds_print.OBJECT.DataWindow.PRINT.MARGIN.bottom=INTEGER(f_ProfileString (sys_empid,ls_parm, "MARGIN_BOTTOM", "30"))
- ds_print.OBJECT.DataWindow.PRINT.MARGIN.right=INTEGER(f_ProfileString (sys_empid,ls_parm, "MARGIN_RIGHT", "30" ))
- ds_print.OBJECT.DataWindow.PRINT.PAPER.SIZE=INTEGER(f_ProfileString (sys_empid,ls_parm, "PAPER_SIZE", "9" ))
- ds_print.OBJECT.DataWindow.PRINT.ORIENTATION=INTEGER(f_ProfileString (sys_empid,ls_parm, "ORIENTATION", "0" ))
- END IF
- fact_print_msg.printrow=INTEGER(f_ProfileString (sys_empid,ls_parm, "printrow", '8'))
- //--------------------------------------------建表
- //if uof_trycreate_sys_dwnsyntax(arg_msg)=0 then
- // rslt=0
- // goto ext
- //end if
- //
- //if uof_defdataobject(arg_msg)=0 then
- // rslt=0
- // goto ext
- //end if
- Ds_Retrieve()
- //if uof_read_subdwpos(default_dwname,default_dname,s_xwidth,arg_msg)=0 then
- // rslt=0
- // goto ext
- //else
- // uof_mdfmxreport(s_xwidth)
- //end if
- ext:
- return rslt
- end function
- public function integer uof_defdataobject (ref string arg_msg);int rslt=1
- long ls_count
- blob sqlblob
- select count(*) into :ls_count from sys_dwnSyntax where dwname=:fact_print_msg.obj_dwname and default_flag=1 ;
- if sqlca.sqlcode=-1 then
- arg_msg='查询单据格式失败'+sqlca.sqlerrtext
- rslt=0
- goto ext
- end if
- if ls_count=1 then
- select dwname,dname into :default_dwname,:default_dname from sys_dwnSyntax where dwname=:fact_print_msg.obj_dwname and default_flag=1 ;
- if sqlca.sqlcode=-1 then
- arg_msg='查询单据格式失败'+sqlca.sqlerrtext
- rslt=0
- goto ext
- end if
-
- if uof_dwcreate(default_dwname,default_dname,arg_msg)=0 then
- arg_msg='打开单据格式失败!原因:'+arg_msg
- rslt=0
- goto ext
- end if
-
- ds_print.settransobject(sqlca)
- end if
- ext:
- return rslt
- end function
- public function integer uof_dwcreate (string arg_dwname, string arg_formatname, ref string arg_msg);blob dwSyntax
- int rslt=1
- selectblob dwSyntaxB into :dwSyntax from sys_dwnSyntax where dwname=:arg_dwname and dname=:arg_formatname;
- if sqlca.sqlcode=-1 then
- arg_msg='查询单据格式失败,原因:'+sqlca.sqlerrtext
- rslt=0
- goto ext
- end if
- if ds_print.create(string(dwSyntax),arg_msg)<>1 then
- rslt=0
- goto ext
- end if
- ext:
- return rslt
- end function
- public function integer ds_retrieve ();//ds_retrieve
- CHOOSE CASE fact_print_msg.retr_pram_falg
- CASE 0 //SHARE DATAWINDOW
- DATAWINDOW LS_DW
- LS_DW = fact_print_msg.SHARE_DW
- LS_DW.ShareData(ds_print)
- CASE 1 //ONE STRING PRAM
- ds_print.Retrieve(fact_print_msg.retr_pramstr)
- CASE 2 //ONE NUMBER PRAM
- ds_print.Retrieve(fact_print_msg.retr_pramnmb)
- retrieveid = fact_print_msg.retr_pramnmb
- CASE 3 //ONE DATE PRAM
- ds_print.Retrieve(fact_print_msg.retr_pramfd)
- CASE 4 //TWO DATE PRAM
- ds_print.Retrieve(fact_print_msg.retr_pramfd,fact_print_msg.retr_pramed)
- CASE 5 //TWO NUMBER PRAM
- ds_print.Retrieve(fact_print_msg.retr_pramnmb,fact_print_msg.b_long)
- CASE 11 //scid string
- ds_print.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramstr)
- CASE 12 //scid long
- ds_print.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb)
- CASE 13 //scid long and TWO NUMBER PRAM
- ds_print.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb,fact_print_msg.b_long)
- CASE 14 //TWO DATETIME PRAM
- ds_print.Retrieve(fact_print_msg.retr_pramfdt,fact_print_msg.retr_pramedt)
- CASE 15 //scid long and TWO NUMBER PRAM and null_row
- uof_nullrow(fact_print_msg.rowcnt,fact_print_msg.printrow,fact_print_msg.nullrow)
- ds_print.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb,fact_print_msg.printrow,fact_print_msg.nullrow)
- CASE 16
- ds_print.Retrieve(fact_print_msg.retr_scid,fact_print_msg.retr_pramnmb,fact_print_msg.printrow)
- CASE ELSE
- ds_print.Retrieve()
- END CHOOSE
- IF fact_print_msg.retr_pram_falg <> 0 THEN
- ds_print.SetFilter(fact_print_msg.FILTER_STRING)
- ds_print.Filter()
- END IF
- RETURN 0
- end function
- public function integer uof_read_subdwpos (string arg_dwname, string arg_dname, ref s_childreportxwidth s_subdwwidth, ref string arg_msg);//uof_read_subdwpos(arg_dwname,arg_dname,arg_msg)
- blob ls_subdwSyntaxB
- int rslt=1
-
- selectblob subdwSyntaxB into :ls_subdwSyntaxB from sys_dwnSyntax where dwname=:arg_dwname and dname=:arg_dname;
- if sqlca.sqlcode=-1 then
- arg_msg='读取单据明细表格式失败!'+sqlca.sqlerrtext
- rslt=0
- goto ext
- end if
- if len(ls_subdwSyntaxB)>0 then
- dwod=ds_print.object.mxreport
- uof_subdwpos_blobtostru(ls_subdwSyntaxB,s_subdwwidth)
- end if
- ext:
- return rslt
- end function
- public subroutine uof_subdwpos_blobtostru (blob arg_blob, ref s_childreportxwidth arg_s_xwidth);//uof_subdwpos_blobtostru(arg_blob,arg_s_xwidth)
- string subdwpos_str,clm_str,cmp_str,clm_strx,clm_strwidth,cmplp_x,cmplp_width
- long clm_p,cmplp,i
- subdwpos_str=string(arg_blob)
- clm_str=mid(subdwpos_str,1,pos(subdwpos_str,'cmplp:') - 1)
- cmp_str=mid(subdwpos_str,pos(subdwpos_str,'cmplp:'))
- clm_strx=mid(clm_str,pos(clm_str,'x:')+2,pos(clm_str,';width:') - pos(clm_str,'x:') - 1 ) //x_str
- clm_strwidth=mid(clm_str,pos(clm_str,'width:') + 6) //width_str
- cmplp_x=mid(cmp_str,pos(cmp_str,'x:')+2,pos(cmp_str,';width:') - pos(cmp_str,'x:') - 1 )
- cmplp_width=mid(cmp_str,pos(cmp_str,'width:') + 6) //cmplpwidth_str
- clm_p=long(mid(clm_str,3,pos(clm_str,';') - 3)) //P
- cmplp=long(mid(cmp_str,7,pos(cmp_str,';') - 7)) //cmplp
- arg_s_xwidth.p=clm_p
- arg_s_xwidth.cmplp=cmplp
- //messagebox('all',subdwpos_str)
- //MEssagebox('clm_str',clm_str)
- //MEssagebox('cmp_str',cmp_str)
- //
- //MEssagebox('clm_p',clm_p)
- //MEssagebox('cmplp',cmplp)
- //
- //MEssagebox('clm_strx',clm_strx)
- //MEssagebox('clm_strwidth',clm_strwidth)
- long xmx
- string xstr
- xmx=0
- xstr=''
- for i =1 to len(clm_strx) //x
- if mid(clm_strx,i,1)<>',' and mid(clm_strx,i,1)<>';' then
- xstr=xstr+mid(clm_strx,i,1)
- else
- xmx++
- arg_s_xwidth.x[xmx]=long(xstr)
- xstr=''
- end if
- next
-
- xmx=0
- xstr=''
- for i =1 to len(clm_strwidth) //width
- if mid(clm_strwidth,i,1)<>',' and mid(clm_strwidth,i,1)<>';' then
- xstr=xstr+mid(clm_strwidth,i,1)
- else
- xmx++
- arg_s_xwidth.width[xmx]=long(xstr)
- xstr=''
- end if
- next
-
- xmx=0
- xstr=''
- for i =1 to len(cmplp_x) //cmplp_x
- if mid(cmplp_x,i,1)<>',' and mid(cmplp_x,i,1)<>';' then
- xstr=xstr+mid(cmplp_x,i,1)
- else
- xmx++
- arg_s_xwidth.cmplx[xmx]=long(xstr)
- xstr=''
- end if
- next
-
- xmx=0
- xstr=''
- for i =1 to len(cmplp_width) //cmplp_width
- if mid(cmplp_width,i,1)<>',' and mid(cmplp_width,i,1)<>';' then
- xstr=xstr+mid(cmplp_width,i,1)
- else
- xmx++
- arg_s_xwidth.cmplwidth[xmx]=long(xstr)
- xstr=''
- end if
- next
-
-
- //messagebox('','sdfsdf')
-
-
-
-
-
-
- end subroutine
- public function integer uof_mdfmxreport (s_childreportxwidth s_xw);//uof_mdfmxreport(s_childreportxwidth)
- if s_xw.p=0 then
- return 0
- end if
- if mod(s_xw.cmplp,2)=1 then
- if s_xw.cmplx[1]>0 then dwod.object.cmpl1.width=s_xw.cmplwidth[1]
- end if
- if s_xw.cmplp=2 or s_xw.cmplp=3 then
- if s_xw.cmplx[2]>0 then dwod.object.cmpl2.width= s_xw.cmplwidth[2]
- end if
- if s_xw.cmplp=4 or s_xw.cmplp=6 or s_xw.cmplp=7 then
- if s_xw.cmplp=6 or s_xw.cmplp=7 then
- if s_xw.cmplx[2]>0 then dwod.object.cmpl2.width= s_xw.cmplwidth[2] //yyx0609
- end if
- if s_xw.cmplx[3]>0 then dwod.object.cmpl3.width= s_xw.cmplwidth[3]
- end if
- if s_xw.x[1]>0 then dwod.object.#1.width=s_xw.width[1]
- if s_xw.p<2 then goto mdfx
- if s_xw.x[2]>0 then dwod.object.#2.width=s_xw.width[2]
- if s_xw.p<3 then goto mdfx
- if s_xw.x[3]>0 then dwod.object.#3.width=s_xw.width[3]
- if s_xw.p<4 then goto mdfx
- if s_xw.x[4]>0 then dwod.object.#4.width=s_xw.width[4]
- if s_xw.p<5 then goto mdfx
- if s_xw.x[5]>0 then dwod.object.#5.width=s_xw.width[5]
- if s_xw.p<6 then goto mdfx
- if s_xw.x[6]>0 then dwod.object.#6.width=s_xw.width[6]
- if s_xw.p<7 then goto mdfx
- if s_xw.x[7]>0 then dwod.object.#7.width=s_xw.width[7]
- if s_xw.p<8 then goto mdfx
- if s_xw.x[8]>0 then dwod.object.#8.width=s_xw.width[8]
- if s_xw.p<9 then goto mdfx
- if s_xw.x[9]>0 then dwod.object.#9.width=s_xw.width[9]
- if s_xw.p<10 then goto mdfx
- if s_xw.x[10]>0 then dwod.object.#10.width=s_xw.width[10]
- if s_xw.p<11 then goto mdfx
- if s_xw.x[11]>0 then dwod.object.#11.width=s_xw.width[11]
- if s_xw.p<12 then goto mdfx
- if s_xw.x[12]>0 then dwod.object.#12.width=s_xw.width[12]
- if s_xw.p<13 then goto mdfx
- if s_xw.x[13]>0 then dwod.object.#13.width=s_xw.width[13]
- if s_xw.p<14 then goto mdfx
- if s_xw.x[14]>0 then dwod.object.#14.width=s_xw.width[14]
- if s_xw.p<15 then goto mdfx
- if s_xw.x[15]>0 then dwod.object.#15.width=s_xw.width[15]
- if s_xw.p<16 then goto mdfx
- if s_xw.x[16]>0 then dwod.object.#16.width=s_xw.width[16]
- if s_xw.p<17 then goto mdfx
- if s_xw.x[17]>0 then dwod.object.#17.width=s_xw.width[17]
- if s_xw.p<18 then goto mdfx
- if s_xw.x[18]>0 then dwod.object.#18.width=s_xw.width[18]
- if s_xw.p<19 then goto mdfx
- if s_xw.x[19]>0 then dwod.object.#19.width=s_xw.width[19]
- if s_xw.p<20 then goto mdfx
- if s_xw.x[20]>0 then dwod.object.#20.width=s_xw.width[20]
- if s_xw.p<21 then goto mdfx
- if s_xw.x[21]>0 then dwod.object.#21.width=s_xw.width[21]
- if s_xw.p<22 then goto mdfx
- if s_xw.x[22]>0 then dwod.object.#22.width=s_xw.width[22]
- if s_xw.p<23 then goto mdfx
- if s_xw.x[23]>0 then dwod.object.#23.width=s_xw.width[23]
- if s_xw.p<24 then goto mdfx
- if s_xw.x[24]>0 then dwod.object.#24.width=s_xw.width[24]
- if s_xw.p<25 then goto mdfx
- if s_xw.x[25]>0 then dwod.object.#25.width=s_xw.width[25]
- if s_xw.p<26 then goto mdfx
- if s_xw.x[26]>0 then dwod.object.#26.width=s_xw.width[26]
- if s_xw.p<27 then goto mdfx
- if s_xw.x[27]>0 then dwod.object.#27.width=s_xw.width[27]
- if s_xw.p<28 then goto mdfx
- if s_xw.x[28]>0 then dwod.object.#28.width=s_xw.width[28]
- if s_xw.p<29 then goto mdfx
- if s_xw.x[29]>0 then dwod.object.#29.width=s_xw.width[29]
- mdfx:
- if mod(s_xw.cmplp,2)=1 then
- if s_xw.cmplx[1]>0 then dwod.object.cmpl1.x= s_xw.cmplx[1] - 9
- end if
- if s_xw.cmplp=2 or s_xw.cmplp=3 then
- if s_xw.cmplx[2]>0 then dwod.object.cmpl2.x= s_xw.cmplx[2] - 9
- end if
- if s_xw.cmplp=4 or s_xw.cmplp=6 or s_xw.cmplp=7 then
- if s_xw.cmplp=6 or s_xw.cmplp=7 then
- if s_xw.cmplx[2]>0 then dwod.object.cmpl2.x= s_xw.cmplx[2] - 9 //yyx0609
- end if
- if s_xw.cmplx[3]>0 then dwod.object.cmpl3.x= s_xw.cmplx[3] - 9
- end if
- long obp,bp,bi,bj,bk
- obp=0
- for bi=1 to s_xw.p
- bp=50000
- bk=0
- for bj=1 to s_xw.p
- if s_xw.x[bj]<bp and s_xw.x[bj]>obp and s_xw.x[bj]>0 then
- bp=s_xw.x[bj]
- bk=bj
- end if
- next
- if mod(s_xw.cmplp,2)=1 then
- if s_xw.cmplx[1]<bp and s_xw.cmplx[1]>obp and s_xw.cmplx[1]>0 then
- bp=s_xw.cmplx[1]
- bk=0
- bi = bi -1
- dwod.object.cmpl1.x= s_xw.cmplx[1] - 9
- end if
- end if
- uof_mdfx(s_xw,bk)
- obp=bp
- next
- if mod(s_xw.cmplp,2)=1 then
- if s_xw.cmplx[1]>0 then dwod.object.cmpl1.x= s_xw.cmplx[1] - 9
- end if
- if s_xw.cmplp=2 or s_xw.cmplp=3 then
- if s_xw.cmplx[2]>0 then dwod.object.cmpl2.x= s_xw.cmplx[2] - 9
- end if
- if s_xw.cmplp=4 or s_xw.cmplp=6 or s_xw.cmplp=7 then
- if s_xw.cmplp=6 or s_xw.cmplp=7 then
- if s_xw.cmplx[2]>0 then dwod.object.cmpl2.x= s_xw.cmplx[2] - 9 //yyx0609
- end if
- if s_xw.cmplx[3]>0 then dwod.object.cmpl3.x= s_xw.cmplx[3] - 9
- end if
- return 0
- end function
- public function integer uof_mdfx (s_childreportxwidth s_xw, integer pt);//uof_mdfx(s_childreportxwidth,int)
- if s_xw.p=0 or pt=0 then
- return 0
- end if
- CHOOSE CASE pt
- CASE 1
- if s_xw.p>=1 and s_xw.x[1]>0 then dwod.object.#1.x=s_xw.x[1] - 9
- CASE 2
- if s_xw.p>=2 and s_xw.x[2]>0 then dwod.object.#2.x=s_xw.x[2] - 9
- CASE 3
- if s_xw.p>=3 and s_xw.x[3]>0 then dwod.object.#3.x=s_xw.x[3] - 9
- CASE 4
- if s_xw.p>=4 and s_xw.x[4]>0 then dwod.object.#4.x=s_xw.x[4] - 9
- CASE 5
- if s_xw.p>=5 and s_xw.x[5]>0 then dwod.object.#5.x=s_xw.x[5] - 9
- CASE 6
- if s_xw.p>=6 and s_xw.x[6]>0 then dwod.object.#6.x=s_xw.x[6] - 9
- CASE 7
- if s_xw.p>=7 and s_xw.x[7]>0 then dwod.object.#7.x=s_xw.x[7] - 9
- CASE 8
- if s_xw.p>=8 and s_xw.x[8]>0 then dwod.object.#8.x=s_xw.x[8] - 9
- CASE 9
- if s_xw.p>=9 and s_xw.x[9]>0 then dwod.object.#9.x=s_xw.x[9] - 9
- CASE 10
- if s_xw.p>=10 and s_xw.x[10]>0 then dwod.object.#10.x=s_xw.x[10] - 9
- CASE 11
- if s_xw.p>=11 and s_xw.x[11]>0 then dwod.object.#11.x=s_xw.x[11] - 9
- CASE 12
- if s_xw.p>=12 and s_xw.x[12]>0 then dwod.object.#12.x=s_xw.x[12] - 9
- CASE 13
- if s_xw.p>=13 and s_xw.x[13]>0 then dwod.object.#13.x=s_xw.x[13] - 9
- CASE 14
- if s_xw.p>=14 and s_xw.x[14]>0 then dwod.object.#14.x=s_xw.x[14] - 9
- CASE 15
- if s_xw.p>=15 and s_xw.x[15]>0 then dwod.object.#15.x=s_xw.x[15] - 9
- CASE 16
- if s_xw.p>=16 and s_xw.x[16]>0 then dwod.object.#16.x=s_xw.x[16] - 9
- CASE 17
- if s_xw.p>=17 and s_xw.x[17]>0 then dwod.object.#17.x=s_xw.x[17] - 9
- CASE 18
- if s_xw.p>=18 and s_xw.x[18]>0 then dwod.object.#18.x=s_xw.x[18] - 9
- CASE 19
- if s_xw.p>=19 and s_xw.x[19]>0 then dwod.object.#19.x=s_xw.x[19] - 9
- CASE 20
- if s_xw.p>=20 and s_xw.x[20]>0 then dwod.object.#20.x=s_xw.x[20] - 9
- CASE 21
- if s_xw.p>=21 and s_xw.x[21]>0 then dwod.object.#21.x=s_xw.x[21] - 9
- CASE 22
- if s_xw.p>=22 and s_xw.x[22]>0 then dwod.object.#22.x=s_xw.x[22] - 9
- CASE 23
- if s_xw.p>=23 and s_xw.x[23]>0 then dwod.object.#23.x=s_xw.x[23] - 9
- CASE 24
- if s_xw.p>=24 and s_xw.x[24]>0 then dwod.object.#24.x=s_xw.x[24] - 9
- CASE 25
- if s_xw.p>=25 and s_xw.x[25]>0 then dwod.object.#25.x=s_xw.x[25] - 9
- CASE 26
- if s_xw.p>=26 and s_xw.x[26]>0 then dwod.object.#26.x=s_xw.x[26] - 9
- CASE 27
- if s_xw.p>=27 and s_xw.x[27]>0 then dwod.object.#27.x=s_xw.x[27] - 9
- CASE 28
- if s_xw.p>=28 and s_xw.x[28]>0 then dwod.object.#28.x=s_xw.x[28] - 9
- CASE 29
- if s_xw.p>=29 and s_xw.x[29]>0 then dwod.object.#29.x=s_xw.x[29] - 9
-
- END CHOOSE
- return 0
- end function
- public subroutine ds_print ();lnv_printer.of_SetDefault ( dw_default_printer )
- ds_print.print()
- end subroutine
- public subroutine uof_nullrow (long arg_rowcnt, long arg_pagerow, ref long arg_nullrow);//====================================================================
- // Function: uof_nullrow()
- //--------------------------------------------------------------------
- // Description:返回加空行数
- //--------------------------------------------------------------------
- // Arguments:
- // value long arg_rowcnt
- // value long arg_pagerow
- // reference long arg_nullrow
- //--------------------------------------------------------------------
- // Returns: (none)
- //--------------------------------------------------------------------
- // Author: yyx Date: 2004.09.13
- //--------------------------------------------------------------------
- // Modify History:
- //
- //====================================================================
- long pagecnt,tal_rowcnt
- pagecnt = long(arg_rowcnt / arg_pagerow)
- tal_rowcnt = arg_rowcnt + pagecnt + 1
- if mod(tal_rowcnt,arg_pagerow)<>0 then
- arg_nullrow = arg_pagerow - mod(tal_rowcnt,arg_pagerow)
- else
- arg_nullrow = 0
- end if
- end subroutine
- on uo_rpt_print_preview.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on uo_rpt_print_preview.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
- event constructor;ds_print = create datastore
- end event
|