Total on GROUP

Total on GROUP

Postby Pedro Sousa e Faro » Mon Sep 11, 2006 12:04 pm

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
User avatar
Pedro Sousa e Faro
 
Posts: 3
Joined: Mon Sep 11, 2006 11:27 am

Postby James Bott » Mon Sep 11, 2006 4:43 pm

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.
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Group Totals

Postby Pedro Sousa e Faro » Mon Sep 11, 2006 5:39 pm

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
User avatar
Pedro Sousa e Faro
 
Posts: 3
Joined: Mon Sep 11, 2006 11:27 am

Total Groups

Postby Pedro Sousa e Faro » Mon Sep 11, 2006 6:25 pm

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
User avatar
Pedro Sousa e Faro
 
Posts: 3
Joined: Mon Sep 11, 2006 11:27 am

Postby James Bott » Mon Sep 11, 2006 7:00 pm

>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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Otto and 62 guests