[Main] dbuse(true) #initparam(printMode,reportId,s_id,tok_cd,seikyu_ymd) initparam(printMode,reportId,s_id,syori_ymd_fr,syori_ymd_to,tok_cd_fr,tok_cd_to,tan_cd_fr,tan_cd_to,ptn) deforgpage(blank) defheadarea(hed) defbodyarea(mei) subroutine(SelectRecords) #合計 setdouble($sum_kungaku,0) setdouble($sum_genkin,0) setdouble($sum_kogitte,0) setdouble($sum_furikomi,0) setdouble($sum_tesuryo,0) setdouble($sum_tegata,0) setdouble($sum_sousai,0) setdouble($sum_sonota,0) setdouble($sum_total_gaku,0) loop(PrintNormal,@rs1,Key1) printreport($printMode,true,false) #------------------------------------------------- # Key1設定ルーチン #------------------------------------------------- [KeyInfo_key1] keyvalue(dummy) keybreakproc(GroupBegin_key1,GroupEnd_key1) #------------------------------------------------- # Key1開始時 #------------------------------------------------- [GroupBegin_key1] deforgpage(blank) #Importするかどうか,FormatNormalするかどうか pageopen(true,true) deforgpage(formats) resetorg() case($ptn0h,$ptn,tok_cd,請求先,日付) #ヘッダ処理_ヘッダー putcell(3,5,@rs1.ymd_start) putcell(3,6,@rs1.ymd_end) putcell(4,2,$ptn0h) #------------------------------------------------- # Key1終了時 #------------------------------------------------- [GroupEnd_key1] #FormatNormalするかどうか formatspecialrow($_row,0,10,1) putline(,,[総合計]#,$sum_kungaku#,$sum_genkin#,$sum_kogitte#,$sum_furikomi#,$sum_tesuryo#,$sum_tegata#,$sum_sousai#,$sum_sonota#,$sum_total_gaku#) pageclose(false) #------------------------------------------------- # Key2設定ルーチン #------------------------------------------------- [KeyInfo_key2] keyvalue(@rs1.tok_cd) keybreakproc(GroupBegin_key2,GroupEnd_key2) #------------------------------------------------- # Key2開始時 #------------------------------------------------- [GroupBegin_key2] setdouble($sum_suryo,0) #------------------------------------------------- # Key2終了時 #------------------------------------------------- [GroupEnd_key2] #FormatNormalするかどうか formatspecialrow($_row,0,5,1) putline(,,,,,[得意先計]#,,$sum_suryo#,,,$sum_kungaku#,,$sum_arari#) sum($r_cnt,1) #pageclose(true) #------------------------------------------------- # SQL実行 #------------------------------------------------- [SelectRecords] new($param) #addparam($param,$s_id) addparam($param,$syori_ymd_fr) addparam($param,$syori_ymd_to) addparam($param,$tok_cd_fr) addparam($param,$tok_cd_to) addparam($param,$tan_cd_fr) addparam($param,$tan_cd_to) addparam($param,$ptn) dbselect(SelectRecords,@rs1,$param) #------------------------------------------------- # 明細表示処理 #------------------------------------------------- [PrintNormal] case($ptn0,$ptn,tok_cd,1,0) case($ptn1,$ptn,tok_cd,0,1) iterate(TOKUI,$ptn0) #改ページ iterate(WEEK,$ptn1) #改ページ #集計:得意先小計 sum($sum_kungaku,@rs1.kingaku) sum($sum_genkin,@rs1.genkin) sum($sum_kogitte,@rs1.kogitte) sum($sum_furikomi,@rs1.furikomi) sum($sum_tesuryo,@rs1.tesuryo) sum($sum_tegata,@rs1.tegata) sum($sum_sousai,@rs1.sousai) sum($sum_sonota,@rs1.sonota) sum($sum_total_gaku,@rs1.total_gaku) [TOKUI] formatspecialrow($_row,0,8,1) putline(,@rs1.keys#,@rs1.tok_nm#,@rs1.kingaku#,@rs1.genkin#,@rs1.kogitte#,@rs1.furikomi#,@rs1.tesuryo#,@rs1.tegata#,@rs1.sousai#,@rs1.sonota#,@rs1.total_gaku#) [WEEK] formatspecialrow($_row,0,5,1) concatenate($formula_str,DATEVALUE\x28TEXT\x28RC\x5b-1\x5d\x2c\x220000\x21\x2f00\x21\x2f00\x22\x29\x29) putformula($_row,3,$formula_str) putline(,@rs1.keys#,,@rs1.kingaku#,@rs1.genkin#,@rs1.kogitte#,@rs1.furikomi#,@rs1.tesuryo#,@rs1.tegata#,@rs1.sousai#,@rs1.sonota#,@rs1.total_gaku#) [Close] pageclose(false) pageopen(true,false)