is it possible to use xbrowse total with a index UNIQUE ?
sample :
A customer can have many bills the same time
each bill can have many positions
each position includes the invoice total
using index UNIQUE I display each bill with the invoice total only once
the problem
xbrowse total is counting ALL positions. UNIQUE is ignored.
another section shows the details of a bill ( positions )
maybe a different solution needed ?
I could calculate each column and display the result using the footer
My working test
counting the column-values
- Code: Select all Expand view
The used and created index
NET_USE ( c_Pfad3 + cRMonat + ".DBF", cRMonat, 3,.F. ) = .T.
ORDCREATE( ,"STAT", "UPPER(PAT_NNAME + PAT_VNAME) + STR(RECHNG_ZAE)", ;
{|| STR(RECHNG_ZAE) } , .T. ) // .T. = UNIQUE
TOTAL defined in xBrowse
WITH OBJECT oBrw1
FOR I := 5 TO 13
:aCols[ I ]:nWidth := 75
:aCols[ I ]:nDataStrAlign := AL_RIGHT
:aCols[ I ]:nHeadStrAlign := AL_CENTER
:MakeTotals() // not working
:aCols[ I ]:lTotal := .T.
:aCols[ I ]:nTotal := 0
NEXT
END
Footer values REPLACED WITH :
(cRMonat)->(DBGOTOP())
nReNr := (cRMonat)->RECHNG_ZAE
DO WHILE !EOF()
IF (cRMonat)->KENNER = "KrK" // different bill-types
nValue[1] += (cRMonat)->K1_SUMME
ELSEIF (cRMonat)->KENNER = "KrX"
nValue[2] += (cRMonat)->K2_SUMME
ELSEIF (cRMonat)->KENNER = "PrX"
nValue[3] += (cRMonat)->PR_SUMME
ELSEIF (cRMonat)->KENNER = "PfK"
nValue[4] += (cRMonat)->P0_SUMME
ELSEIF (cRMonat)->KENNER = "PfB"
nValue[5] += (cRMonat)->P1_SUMME
ELSEIF (cRMonat)->KENNER = "B1K"
nValue[6] += (cRMonat)->PB1_SUMME
ELSEIF (cRMonat)->KENNER = "B1P"
nValue[7] += (cRMonat)->PB2_SUMME
ELSEIF (cRMonat)->KENNER = "B2K"
nValue[8] += (cRMonat)->P2_SUMME
ELSEIF (cRMonat)->KENNER = "B2P"
nValue[9] += (cRMonat)->P3_SUMME
ENDIF
(cRMonat)->(DBSKIP(+1))
IF nReNr = (cRMonat)->RECHNG_ZAE
(cRMonat)->(DBSKIP(+1))
nReNr := (cRMonat)->RECHNG_ZAE
ENDIF
ENDDO
best regards
Uwe