PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WB19]Looper Sub-Totals
[WB19]Looper Sub-Totals
Iniciado por guest, 06,ago. 2015 14:50 - 3 respuestas
Publicado el 06,agosto 2015 - 14:50
Hi

I have a looper with a variable array data source. Let's say invoices by customer.

My looper is grouping the invoices per customer nicely but is there a way in Webdev to get a sub-total displayed of total invoice amounts per customer.

Thanks in advance.


Ericus Steyn
Publicado el 06,agosto 2015 - 19:48
In a table it is possible to make breaks. I gues with loopers that is possible as well. In the break you can set a static on witch you can bind a calculation of the total I donnot know but this would be my first guess to look


regards
Allard
Publicado el 07,agosto 2015 - 07:03
Thanks Allard

Yes that is what I have done as well. It is the calculation of that sub-total where the problem lies.

Regards


Ericus
Publicado el 10,agosto 2015 - 22:33
Hi Ericus,

I'converting a WD16 project to WB20 and was able to use the same code in a table with breaks in WB20.
I don't know if this works in WB19 though.

nRow=1 WHILE nRow <= Table_Lessen_Uit..Occurrence // Subscript of the current break nBreakHeader=TableBreakSubscript(Table_Lessen_Uit.BRK_BreakHeader1,nRow) nBreakFooter=TableBreakSubscript(Table_Lessen_Uit.BRK_BreakFooter1,nRow) IF NOT HReadSeekFirst(qry_Sectieleden_Jaar,PersNr,col_PersNr[nRow]) THEN HReset(qry_Sectieleden_Jaar) Table_Lessen_Uit[nBreakHeader].stc_NaamPers=qry_Sectieleden_Jaar.NaamVol cyLessen=0 nKlokuren=0 FOR i=nBreakHeader _TO_ nBreakFooter cyLessen+=Table_Lessen_Uit.col_Lessen nKlokuren+=Table_Lessen_Uit.col_KU END Table_Lessen_Uit[nBreakFooter].FSTC_Lessen=cyLessen Table_Lessen_Uit[nBreakFooter].FSTC_Klokuren=nKlokUren // Go to the next break nRow=nBreakFooter+1 END
Hope this works for you.

Regards,
Piet