Page 1 of 1

Total on GROUP

Posted: Mon Sep 11, 2006 12:04 pm
by Pedro Sousa e Faro
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

Posted: Mon Sep 11, 2006 4:43 pm
by James Bott
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.

Group Totals

Posted: Mon Sep 11, 2006 5:39 pm
by Pedro Sousa e Faro
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

Total Groups

Posted: Mon Sep 11, 2006 6:25 pm
by Pedro Sousa e Faro
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

Posted: Mon Sep 11, 2006 7:00 pm
by James Bott
>I discovered the solution. I need to force de Atotal[4]

Right. Sorry I didn't mention that.

Glad to hear you got it working.

James