[Main] dbuse(true) initparam(printMode,reportId,s_id) deforgpage(blank) defheadarea(hed) defbodyarea(mei) subroutine(SelectRecords) loop(PrintNormal,@rs1,Key0,Key1) printreport($printMode,true) #------------------------------------------------- # Key0設定ルーチン #------------------------------------------------- [KeyInfo_key0] keyvalue(DUMMY) keybreakproc(GroupBegin_key0,GroupEnd_key0) #------------------------------------------------- # Key0開始時 #------------------------------------------------- [GroupBegin_key0] deforgpage(blank) #Importするかどうか,FormatNormalするかどうか pageopen(true,true) deforgpage(formats) resetorg() #------------------------------------------------- # Key0終了時 #------------------------------------------------- [GroupEnd_key0] #FormatNormalするかどうか #formatspecialrowrange($start_row,$current_row,5,1) pageclose(false) #------------------------------------------------- # Key1設定ルーチン #------------------------------------------------- [KeyInfo_key1] #keyvalue(DUMMY) keyvalue(@rs1.den_no) keybreakproc(GroupBegin_key1,GroupEnd_key1) #------------------------------------------------- # Key1開始時 #------------------------------------------------- [GroupBegin_key1] #ヘッダ処理 putcell($_row,1,売上) putcell($_row,2,@rs1.den_no) putcell($_row,3,@rs1.tok_nm) putcell($_row,4,@rs1.hin_nm) putcell($_row,5,@rs1.tanka) setdouble($start_row,$row_no) setdouble($sum_kingaku,0) #行カウンタ setdouble($current_row,0) #------------------------------------------------- # Key1終了時 #------------------------------------------------- [GroupEnd_key1]. formatspecialrow($_row,0,6,1) #putformula($_row,10,SUM\x28RC[-8]\x2CRC[-6]\x2CRC[-2]\x29 + RC[-4]) #putcell($_row,11,$sum_kingaku) putline(,,,@rs1.jucyu_su,,,,,,,$sum_kingaku#) setdouble($current_row,0) #HPAGEBREAK($_row) #------------------------------------------------- # SQL実行 #------------------------------------------------- [SelectRecords] new($param) addparam($param,$s_id) dbselect(SelectRecords,@rs1,$param) #------------------------------------------------- # 明細表示処理 #------------------------------------------------- [PrintNormal] #putline(,@rs1.den_no,@rs1.tok_nm,@rs1.hin_nm,@rs1.tanka#,,@rs1.chin_cd,@rs1.chin_nm,@rs1.ctanka#,@rs1.set_su#,@rs1.kingaku#,,,,,,) formatspecialrow($_row,0,5,1) putline(,,,,,,@rs1.chin_cd,@rs1.chin_nm,@rs1.ctanka#,@rs1.set_su#,@rs1.kingaku#,,,,,,) #div($current_row,10,$kekka,$amari) #case($original_row,$amari,5,13,6,14,7,15,8,16,9,17,18) sum($current_row,1) sum($sum_kingaku,@rs1.kingaku)