FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Total on GROUP
Posts: 3
Joined: Mon Sep 11, 2006 11:27 AM
Total on GROUP
Posted: 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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Total on GROUP
Posted: Mon Sep 11, 2006 04: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.

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 3
Joined: Mon Sep 11, 2006 11:27 AM
Group Totals
Posted: Mon Sep 11, 2006 05: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

Posts: 3
Joined: Mon Sep 11, 2006 11:27 AM
Total Groups
Posted: Mon Sep 11, 2006 06: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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Total on GROUP
Posted: Mon Sep 11, 2006 07: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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10

Continue the discussion