Hi
Total in Groups are made with the sum of each column in report
But i need in GROUP TOTAL that the total with be made with a formula not with the sum . In a column like $ the Percent't Total is not the sum of the % but the % of the the columns .
ex.
Total 1 Total 2 %
XPTO 1000 2000 xxx
...
...
Group TOTAL aaaa bbbb (aaaa-bbbb)
Best regards
Total on GROUP
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
Group Totals
Here is how you can get access to the group totals:
oReport:bEndGroup:={ | oCol | msgInfo( oCol:oReport:aGroups[1]:aTotal[4]) }
This would show the group total for column 4 of group 1 (if you are only using one group then it will be 1.
Note that bEndgroup is eval'd before the total is printed.
Example: You could probably use oReport:cargo to hold a record count and then use it to find the average.
Here is how you can get access to the group totals:
oReport:bEndGroup:={ | oCol | msgInfo( oCol:oReport:aGroups[1]:aTotal[4]) }
This would show the group total for column 4 of group 1 (if you are only using one group then it will be 1.
Note that bEndgroup is eval'd before the total is printed.
Example: You could probably use oReport:cargo to hold a record count and then use it to find the average.
- Pedro Sousa e Faro
- Posts: 3
- Joined: Mon Sep 11, 2006 11:27 am
Group Totals
Hi James
Tanks for your reply.
You understand my question and i'm realy near the solution . Whay i need to know is how i print it.
My code:
COLUMN TITLE "FORNECEDOR" DATA cod_fornec+' '+nome_for FONT 2 GRID
COLUMN TITLE "FACTURADO" DATA val_fac PICTURE '99 999 999 999.99' TOTAL FONT 2 GRID
COLUMN TITLE "DIVIDA" DATA val_div PICTURE '99 999 999 999.99' TOTAL FONT 2 GRID
COLUMN TITLE "P.M.P("+iif(tcalc=1,"Dias","Meses")+")" DATA pmp PICTURE '99 999' FONT 2 GRID
GROUP ON cod_fac;
HEADER cod_fac+'-'+nome_fac;
FOOTER "Total factor - "+oReport:aGroups[1]:cValue+ ;
" ("+ltrim(str(oReport:aGroups[1]:nCounter))+")";
FONT 1
pmp_g:=(aGroups[1]:aTotal[3] / aGroups[1]:aTotal[3]) * iif(tcalc=1,365,12)
?? How can i print pmp_g ?? under the 4 column
END REPORT
Activate Report oReport ON STARTGROUP oReport:NewLine()
Best regards
Tanks for your reply.
You understand my question and i'm realy near the solution . Whay i need to know is how i print it.
My code:
COLUMN TITLE "FORNECEDOR" DATA cod_fornec+' '+nome_for FONT 2 GRID
COLUMN TITLE "FACTURADO" DATA val_fac PICTURE '99 999 999 999.99' TOTAL FONT 2 GRID
COLUMN TITLE "DIVIDA" DATA val_div PICTURE '99 999 999 999.99' TOTAL FONT 2 GRID
COLUMN TITLE "P.M.P("+iif(tcalc=1,"Dias","Meses")+")" DATA pmp PICTURE '99 999' FONT 2 GRID
GROUP ON cod_fac;
HEADER cod_fac+'-'+nome_fac;
FOOTER "Total factor - "+oReport:aGroups[1]:cValue+ ;
" ("+ltrim(str(oReport:aGroups[1]:nCounter))+")";
FONT 1
pmp_g:=(aGroups[1]:aTotal[3] / aGroups[1]:aTotal[3]) * iif(tcalc=1,365,12)
?? How can i print pmp_g ?? under the 4 column
END REPORT
Activate Report oReport ON STARTGROUP oReport:NewLine()
Best regards
- Pedro Sousa e Faro
- Posts: 3
- Joined: Mon Sep 11, 2006 11:27 am
Total Groups
Hi James
I discovered the solution. I need to force de Atotal[4]
oReport:bEndGroup:={ | oCol | (oCol:oReport:aGroups[1]:aTotal[4]:=(oCol:oReport:aGroups[1]:aTotal[3] / oCol:oReport:aGroups[1]:aTotal[2]) * iif(tcalc=1,365,12) )}
Regards
Pedro
I discovered the solution. I need to force de Atotal[4]
oReport:bEndGroup:={ | oCol | (oCol:oReport:aGroups[1]:aTotal[4]:=(oCol:oReport:aGroups[1]:aTotal[3] / oCol:oReport:aGroups[1]:aTotal[2]) * iif(tcalc=1,365,12) )}
Regards
Pedro
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact: