| --在上述代码基础上,添加判断分支,根据不同判断决定是否打印不同的LIS文件 代码如下: #define addtlsetup #include 'Rptstub.lib' #include '{libpath}tkit_batchstartup.inc' #include '{libpath}tkit_rptheader.inc' #include '{libpath}tkit_queappl.inc' #include '{libpath}tkit_vars_opts.inc' #include '{libpath}tkit_Sqrfunc.inc' begin-setup Declare-layout batch-land rientation=landscape left-margin=0 top-margin=0 max-lines=60 max-columns=180 end-declare end-setup !主过程调用其它子过程 begin-procedure osi-main begin-select count(*) &a_1_rowcount from osibank.zxytestsqr z where z.a=1 end-select begin-select count(*) &a_2_rowcount from osibank.zxytestsqr z where z.a=2 end-select if &a_1_rowcount>0 do query_a_1 end-if if &a_2_rowcount>0 do query_a_2 end-if end-procedure !查询a=1 begin-procedure query_a_1 let $out1='查询1'||'.LIS' new-report $out1 begin-select position (+1) a &a1 move &a1 to #a1 print #a1 (,20,10) edit 9 b &b1 move &b1 to #b1 print #b1 (,40,10) edit 9 from osibank.zxytestsqr z where z.a=1 end-select end-procedure !查询a=2 begin-procedure query_a_2 let $out2='查询2'||'.LIS' new-report $out2 begin-select position (+1) a &a2 move &a2 to #a2 print #a2 (,60,10) edit 9 b &b2 move &b2 to #b2 print #b2 (,80,10) edit 9 from osibank.zxytestsqr z where z.a=2 end-select end-procedure begin-procedure OSI-Startup End-procedure |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-713575/ ,如需转载,请注明出处,否则将追究法律责任。