No funciona treport con arrays y group?
Posted: Tue Mar 10, 2009 3:00 am
TENGO UN REPORTE SOBRE UN ARREGLO
Y CUANDO UTILIZO LA OPCION GROUP ME MANDA UN ERROR
Application
===========
Path and name: C:\GPM\SISTEMA\WGPM.exe (32 bits)
Size: 2,893,312 bytes
Time from start: 0 hours 0 mins 16 secs
Error occurred at: 03/09/2009, 20:57:06
Usuario : MARCO / Marco Augusto Rodriguez Manzo
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 178
Stack Calls
===========
Called from: cmov9.prg => (b)RGASCOMP(640)
EL CODIGO ES EL SIGUIENTE:
AREP2:=ASORT(AREP,,,{|X,Y| X[7]<Y[7]})
DEFINE FONT oFont1 NAME "TAHOMA" SIZE 0,-8 BOLD
DEFINE FONT oFont2 NAME "TAHOMA" SIZE 0,-8
DEFINE FONT oFont3 NAME "TAHOMA" SIZE 0,-12
DEFINE FONT oFont4 NAME "TAHOMA" SIZE 0,-10 BOLD
I:= 1 ; nHasta := LEN(AREP)
REPORT oReport TITLE TIT1,TIT2,TIT3 HEADER X_CIA CENTER ;
FOOTER "PAGINA: "+TRANS(oreport:npage,"999")+SPACE(40)+;
"FECHA : "+TRANS(FECHASIS,"@E") CENTER ;
FONT oFont1,oFONT2,oFONT3,oFONT4 FROM USER PREVIEW
GROUP ON AREP2[I,7] FOOTER " " HEADER " "
COLUMN TITLE "RESPON" DATA AREP2[I,7] GRID
COLUMN TITLE "NUMERO" DATA CIZQ(AREP2[I,1],8) GRID
COLUMN TITLE "NUMSOL" DATA IIF(AREP2[I,2]=0,' ',CIZQ(AREP2[I,2],8)) SIZE 10 GRID
COLUMN TITLE "FECHA" DATA TRANS(AREP2[I,3],'@E') GRID
COLUMN TITLE "ASUNTO" DATA TRANS(AREP2[I,4],'@X') SIZE 40 GRID
COLUMN TITLE "IMPORTE SOLICITUD" DATA AREP2[I,5] PICTURE "999,999,999.99" TOTAL GRID
oReport:oHeader:afont[1]:={||3}
oReport:oTITLE:afont[1] :={||4}
oReport:oTITLE:afont[2] :={||4}
oReport:oFOOTER:afont[1]:={||2}
oReport:CELLVIEW()
oReport:bWhile := { || I <= nHasta }
IF oReport:lCreated
oReport:bSkip := { | | I++}
ENDI
END REPORT
ACTIVATE REPORT oReport
oFont1:End()
oFont2:End()
oFont3:End()
oFont4:End()
Y CUANDO UTILIZO LA OPCION GROUP ME MANDA UN ERROR
Application
===========
Path and name: C:\GPM\SISTEMA\WGPM.exe (32 bits)
Size: 2,893,312 bytes
Time from start: 0 hours 0 mins 16 secs
Error occurred at: 03/09/2009, 20:57:06
Usuario : MARCO / Marco Augusto Rodriguez Manzo
Error description: Error BASE/1132 Bound error: array access
Args:
[ 1] = A { ... }
[ 2] = N 178
Stack Calls
===========
Called from: cmov9.prg => (b)RGASCOMP(640)
EL CODIGO ES EL SIGUIENTE:
AREP2:=ASORT(AREP,,,{|X,Y| X[7]<Y[7]})
DEFINE FONT oFont1 NAME "TAHOMA" SIZE 0,-8 BOLD
DEFINE FONT oFont2 NAME "TAHOMA" SIZE 0,-8
DEFINE FONT oFont3 NAME "TAHOMA" SIZE 0,-12
DEFINE FONT oFont4 NAME "TAHOMA" SIZE 0,-10 BOLD
I:= 1 ; nHasta := LEN(AREP)
REPORT oReport TITLE TIT1,TIT2,TIT3 HEADER X_CIA CENTER ;
FOOTER "PAGINA: "+TRANS(oreport:npage,"999")+SPACE(40)+;
"FECHA : "+TRANS(FECHASIS,"@E") CENTER ;
FONT oFont1,oFONT2,oFONT3,oFONT4 FROM USER PREVIEW
GROUP ON AREP2[I,7] FOOTER " " HEADER " "
COLUMN TITLE "RESPON" DATA AREP2[I,7] GRID
COLUMN TITLE "NUMERO" DATA CIZQ(AREP2[I,1],8) GRID
COLUMN TITLE "NUMSOL" DATA IIF(AREP2[I,2]=0,' ',CIZQ(AREP2[I,2],8)) SIZE 10 GRID
COLUMN TITLE "FECHA" DATA TRANS(AREP2[I,3],'@E') GRID
COLUMN TITLE "ASUNTO" DATA TRANS(AREP2[I,4],'@X') SIZE 40 GRID
COLUMN TITLE "IMPORTE SOLICITUD" DATA AREP2[I,5] PICTURE "999,999,999.99" TOTAL GRID
oReport:oHeader:afont[1]:={||3}
oReport:oTITLE:afont[1] :={||4}
oReport:oTITLE:afont[2] :={||4}
oReport:oFOOTER:afont[1]:={||2}
oReport:CELLVIEW()
oReport:bWhile := { || I <= nHasta }
IF oReport:lCreated
oReport:bSkip := { | | I++}
ENDI
END REPORT
ACTIVATE REPORT oReport
oFont1:End()
oFont2:End()
oFont3:End()
oFont4:End()