[Main]
dbuse(true)
initparam(printMode,reportId,anken_cd,syori_ymd_fr,syori_ymd_to,base_ymd,kousyu_cd,chk_row1,chk_row2,chk_row3,chk_row4,chk_row5,chk_row6,tan_cd,chk_status_jucyu,chk_status_mi,chk_status_end,chk_status_stop,chk_status_cancel,sedai_cd,anken_kbn)
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)

[KeyInfo_key1]
keyvalue(@rs1.anken_cd)
keybreakproc(GroupBegin_key1,GroupEnd_key1)

#-------------------------------------------------
#  Key0�J�n��
#-------------------------------------------------
[GroupBegin_key0]
deforgpage(blank)
#Import���邩�ǂ���,FormatNormal���邩�ǂ���
pageopen(true,false)
deforgpage(formats)
resetorg()
setdouble($row,7)
setdouble($col,15)
#�w�b�_����
putcell(1,4,@rs1.base_ymd)

[GroupBegin_key1]
setdouble($row_1,$_row)
sum($row_1,1)
putcell($row_1,1,@rs1.anken_cd)
putcell($row_1,2,@rs1.anken_nm)
#putcell($row_1,3,@rs1.koutei_nm)
formatspecialrow($_row,0,3,2)

#-------------------------------------------------
#  Key0�I����
#-------------------------------------------------
[GroupEnd_key0]
#formatspecialrow($_row,0,4,1)
#FormatNormal���邩�ǂ���
pageclose(false)

[GroupEnd_key1]

#-------------------------------------------------
#  SQL���s
#-------------------------------------------------
[SelectRecords]
new($param)
addparam($param,$anken_cd)
addparam($param,$syori_ymd_fr)
addparam($param,$syori_ymd_to)
addparam($param,$base_ymd)
addparam($param,$tan_cd)
addparam($param,$anken_kbn)
dbselect(SelectRecords,@rs1,$param)

#-------------------------------------------------
#  ���ו\������
#-------------------------------------------------
[PrintNormal]
setdouble($row_under,$_row)
sum($row_under,1)
putline(,,,@rs1.c1,@rs1.c2,@rs1.c3,@rs1.c4,@rs1.c5,@rs1.c6,@rs1.c7,@rs1.c8,@rs1.c9,@rs1.c10,@rs1.c11,@rs1.c12,@rs1.c13,@rs1.c14)
putcell($row_under,3,@rs1.koutei_nm)
#setdouble($col_stt,3)
#setdouble($col_end,3)
#sum($col_stt,@rs1.stt_pos)
#sum($col_end,@rs1.end_pos)
#putcell($_row,$col_stt,@rs1.stt_label)
#putcell($_row,$col_end,@rs1.end_label)
putline()
formatspecialrow($_row,0,5,2)

[BK_PrintNormal]
#formatspecialrow($_row,8,7,8)

putcell($row,1,@rs1.anken_cd)
putcell($row,5,@rs1.title)
#putcell($row,5,@rs1.tan_kind2)
#putcell($row,5,@rs1.tan_kind3)
#putcell($row,5,@rs1.tan_kind4)
#putcell($row,5,5)
#putcell($row,5,6)
#putcell($row,5,7)
#putcell($row,5,8)
putcell($row,8,@rs1.title)
#putcell($row,8,@rs1.tan_nm2)
#putcell($row,8,@rs1.tan_nm3)
#putcell($row,8,@rs1.tan_nm4)
#putcell($row,8,5)
#putcell($row,8,6)
#putcell($row,8,7)
#putcell($row,8,8)
putcell($row,10,@rs1.title)
#putcell($row,10,@rs1.title2)
#putcell($row,10,@rs1.title3)
#putcell($row,10,@rs1.title4)
#putcell($row,10,@rs1.title5)
#putcell($row,10,@rs1.title6)
#putcell($row,10,@rs1.title7)
#putcell($row,10,@rs1.title8)
#putcell($row,$col,@rs1.kouki)
putcell($row,$col,@rs1.meisai)
#putcell($row,$col,@rs1.yotei_end_time)
#putcell($row,$col,@rs1.kouki_std)
#putcell($row,$col,@rs1.yotei_end_time)
#concatenate($formula_str1,IF\x28RC[-4]\x3d"" \x2c ""\x2c RC[-12]-RC[-4]\x29)
#putformula($row,$col,$formula_str1)
#putcell($row,$col,@rs1.stop_time)
#putcell($row,$col,@rs1.status_nm)
#concatenate($formula_str2,IF\x28RC[-4]\x3d"" \x2c ""\x2c RC[-12]-RC[-4]\x29)
#putformula($row,$col,$formula_str2)
#concatenate($formula_str3,IF\x28RC[-4]\x3d"" \x2c ""\x2c RC[-12]-RC[-4]\x29)
#putformula($row,$col,$formula_str3)
putline(,)
#sum($row,1)
sum($col,4)