James
not all the reports can be make with two groups
I should evaluate each register of the table in runtime.
this is my code but i get the message: TRGroup does not exist
REPORT oRpt ;
...
GROUP oGrp1 ;
ON Left(TMP->Cuenta,2) ;
HEADER Left(TMP->Cuenta,2)+' '+ACONCUE->Descrip;
FOOTER 'Total :' ;
FONT 5
GROUP oGrp2 ;
ON Left(TMP->Cuenta,4) ;
HEADER Left(TMP->Cuenta,4)+' '+ACONCUE->Descrip;
FOOTER 'SubTotal :' ;
FONT 5
COLUMN TITLE " ","Cuenta" ;
DATA TMP->CUENTA ;
FONT 2 SIZE 9
COLUMN TITLE " ","Ruc" ;
DATA TMP->Ruc ;
FONT 2 SIZE 15 aadd(oRpt:aGroups, oRpt:aGroups[3])
...
...
ACTIVATE REPORT oRpt ;
ON STARTGROUP iif(len(tmp->cuentat)=8,createnewgroup(),);
ON ENDGROUP iif(len(oRpt:aGroups)=3, eval({||oRpt:Delgroup(3), oRpt:Stabilize() }),)
END REPORT
Static Function createnewgroup()
oGrp3:= TRGroup:New({|| tmp->cuenta }, {|| tmp->cuenta+" "+aconcue->descrip}, {|| "Subtotal" }, , , oRpt) // Abort TRGroup does not exist
oRpt:Stabilize()
Return Nil