[Main] dbuse(true) initparam(printMode,reportId,han_name,bum_cd,bum_nm,tok_cat_cd,tok_cat_nm,sir_cat_cd,sir_cat_nm,dcat_cd_fr,dcat_cd_to,dcat_nm_fr,dcat_nm_to,cat_cd_fr,cat_cd_to,cat_nm_fr,cat_nm_to,syori_ymd_fr,syori_ymd_to,taisyo_y,taisyo_m,tok_cd_fr,tok_cd_to,sir_cd_fr,sir_cd_to,tan_cd_fr,tan_cd_to,tan_nm_fr,tan_nm_to,hin_cd_fr,hin_cd_to,put_on) deforgpage(blank) defheadarea(hed) defbodyarea(mei) subroutine(SelectRecords) loop(PrintNormal,@rs1,key0,Key1,Key2,Key3,Key4) printreport($printMode,true,,BASB0010:BASR0570) #------------------------------------------------- # SQL実行 #------------------------------------------------- [SelectRecords] new($param) addparam($param,$han_name) addparam($param,$bum_cd) addparam($param,$bum_nm) addparam($param,$tok_cat_cd) addparam($param,$tok_cat_nm) addparam($param,$sir_cat_cd) addparam($param,$sir_cat_nm) addparam($param,$dcat_cd_fr) addparam($param,$dcat_cd_to) addparam($param,$dcat_nm_fr) addparam($param,$dcat_nm_to) addparam($param,$cat_cd_fr) addparam($param,$cat_cd_to) addparam($param,$cat_nm_fr) addparam($param,$cat_nm_to) addparam($param,$syori_ymd_fr) addparam($param,$syori_ymd_to) addparam($param,$taisyo_y) addparam($param,$taisyo_m) addparam($param,$tok_cd_fr) addparam($param,$tok_cd_to) addparam($param,$sir_cd_fr) addparam($param,$sir_cd_to) addparam($param,$tan_cd_fr) addparam($param,$tan_cd_to) addparam($param,$tan_nm_fr) addparam($param,$tan_nm_to) addparam($param,$hin_cd_fr) addparam($param,$hin_cd_to) addparam($param,$put_on) dbselect(SelectRecords,@rs1,$param) #------------------------------------------------- # SQL実行 #------------------------------------------------- [selectGraph] new($param) addparam($param,$han_name) addparam($param,$bum_cd) addparam($param,$bum_nm) addparam($param,$tok_cat_cd) addparam($param,$tok_cat_nm) addparam($param,$sir_cat_cd) addparam($param,$sir_cat_nm) addparam($param,$dcat_cd_fr) addparam($param,$dcat_cd_to) addparam($param,$dcat_nm_fr) addparam($param,$dcat_nm_to) addparam($param,$cat_cd_fr) addparam($param,$cat_cd_to) addparam($param,$cat_nm_fr) addparam($param,$cat_nm_to) addparam($param,$syori_ymd_fr) addparam($param,$syori_ymd_to) addparam($param,$taisyo_y) addparam($param,$taisyo_m) addparam($param,$tok_cd_fr) addparam($param,$tok_cd_to) addparam($param,$sir_cd_fr) addparam($param,$sir_cd_to) addparam($param,$tan_cd_fr) addparam($param,$tan_cd_to) addparam($param,$tan_nm_fr) addparam($param,$tan_nm_to) addparam($param,$hin_cd_fr) addparam($param,$hin_cd_to) addparam($param,$put_on) dbselect(selectGraph,@rs2,$param) #------------------------------------------------- # グラフ処理 明細表示 #------------------------------------------------- [PrintGraph] concatenate($hin_s,@rs2.hin_cd, ,@rs2.hin_nm) putcell($_gru,$graph_col_key,$hin_s) putcell($_gru,$graph_col_value,@rs2.kingaku) sum($_gru,1) #------------------------------------------------- # グラフ処理 #------------------------------------------------- [LoadGraphData] setdouble($graph_col_key,7)#グラフ品名表示列 setdouble($graph_col_value,8)#グラフ金額表示列 setdouble($_gru,5)#グラフ開始行 初期位置 #SQL実行 グラフ subroutine(selectGraph) loop(PrintGraph,@rs2) #------------------------------------------------- # key0設定ルーチン #------------------------------------------------- [KeyInfo_key0] keyvalue(dummy) keybreakproc(GroupBegin_key0,GroupEnd_key0) #------------------------------------------------- # key0開始時 #------------------------------------------------- [GroupBegin_key0] deforgpage(blank) #Importするかどうか,FormatNormalするかどうか pageopen(true,false) deforgpage(formats) resetorg() #抽出条件 表示処理 concatenate($bum_nm_l,部門:,$bum_nm) concatenate($tan_nm_l,担当者名:,$tan_nm_fr,〜,$tan_nm_to) concatenate($sir_cat_l,仕入先分類:,$sir_cat_nm) concatenate($dhin_cat_l,商品大分類:,$dcat_nm_fr,〜,$dcat_nm_to) concatenate($hin_cat_l,商品分類:,$cat_nm_fr,〜,$cat_nm_to) concatenate($sir_nm_l,仕入先:,$sir_cd_fr, ,@rs1.sir_nm_fr,〜,$sir_cd_to, ,@rs1.sir_nm_to) #concatenate($ROE,抽出条件 部門:,$bum_nm, 担当者名:,$tan_nm, 仕入先分類:,$sir_cat_nm, 商品大分類:,$dcat_nm, 商品分類:,$cat_nm) concatenate($ROE,(抽出条件 ,$bum_nm_l,/,$tan_nm_l,/,$sir_cat_l,)) concatenate($ROE2,(抽出条件 ,$dhin_cat_l,/,$hin_cat_l,/,$sir_nm_l,)) putcell(11,1,$han_name)#帳票タイトル putcell(11,6,指定期間) putcell(11,7,@rs1.dt_fr) putcell(11,8,@rs1.dt_to) putcell(13,1,$ROE) putcell(14,1,$ROE2) #------------------------------------------------- # key0終了時 #------------------------------------------------- [GroupEnd_key0] #グラフ処理 subroutine(LoadGraphData) pageclose(false) #------------------------------------------------- # Key1設定ルーチン #------------------------------------------------- [KeyInfo_key1] keyvalue(@rs1.cd) keybreakproc(GroupBegin_key1,GroupEnd_key1) #------------------------------------------------- # Key1開始時 #------------------------------------------------- [GroupBegin_key1] case($cd,@rs1.cd,,0,null,0,1) iterate(CD,$cd) [CD] putcell($_row,1,@rs1.han) putline() #------------------------------------------------- # Key1終了時 #------------------------------------------------- [GroupEnd_key1] #------------------------------------------------- # Key2設定ルーチン #------------------------------------------------- [KeyInfo_key2] keyvalue(@rs1.cd,@rs1.sir_cd,@rs1.sir_nm) keybreakproc(GroupBegin_key2,GroupEnd_key2) #------------------------------------------------- # Key2開始時 #------------------------------------------------- [GroupBegin_key2] case($sir,@rs1.sir_cd,,0,1) iterate(SIR,$sir) [SIR] putcell($_row,2,@rs1.sir_nm) putline() #------------------------------------------------- # Key2終了時 #------------------------------------------------- [GroupEnd_key2] #------------------------------------------------- # key3設定ルーチン #------------------------------------------------- [KeyInfo_key3] keyvalue(@rs1.cd,@rs1.sir_cd,@rs1.sir_nm,@rs1.cd2) keybreakproc(GroupBegin_key3,GroupEnd_key3) #------------------------------------------------- # key3開始時 #------------------------------------------------- [GroupBegin_key3] case($han2,@rs1.cd2,,0,1) iterate(HAN2,$han2) [HAN2] putcell($_row,3,@rs1.han2) putline() #------------------------------------------------- # key3終了時 #------------------------------------------------- [GroupEnd_key3] #------------------------------------------------- # key4設定ルーチン #------------------------------------------------- [KeyInfo_key4] keyvalue(@rs1.cd,@rs1.sir_cd,@rs1.sir_nm,@rs1.cd2,@rs1.cd1) keybreakproc(GroupBegin_key4,GroupEnd_key4) #------------------------------------------------- # key4開始時 #------------------------------------------------- [GroupBegin_key4] case($han1,@rs1.cd1,,0,1) iterate(HAN1,$han1) [HAN1] putcell($_row,4,@rs1.han1) putline() #------------------------------------------------- # key4終了時 #------------------------------------------------- [GroupEnd_key4] #------------------------------------------------- # 明細表示処理 #------------------------------------------------- [PrintNormal] putcell($_row,5,@rs1.hin_cd) putcell($_row,6,@rs1.hin_nm) putline(,,,,,,@rs1.suryo#,@rs1.kingaku#)