Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP8/9 Function in detail band of report problem
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01101094
Message ID:
01101222
Vues:
14
On my system, and all of our users, whenever the user clicks on the report (anywhere on the report) it switches the zoom level up and down. In the detail band, a function is called which increments based on the value in the current record. Zooming in/out on our systems in both 8 and 8 call the function over and over and the total is incremented by the values display on the current page. For instance, if there are 5 records that are displayed on page one in preview mode like:

The programs which call this frx all set totcomcash to 0 before anything else is done at the top of the prg.

For example, if type 1 = cash, type 2 = chk, type 3 = checkforward
record     type   commission    amount
recno()   re_type   camt       namount
1           1       50.00      1000.00
2           1       10.00       800.00
3           2       10.00       900.00
4           1       50.00      1000.00
5           3       10.00       800.00
in the detail band at the far left of the detail line there is a field whose expression is
chkcomm('XMITTAL'). In the chkcomm function something similar to the following occurs:
FUNCTION chkcomm
lparameters xreport

IF re_type = '1'
   totcomcash = totcomcash + camt
ENDIF
RETURN
In the summary band, totcomcash should equal 110.00 based on the 5 line items above. It does equal the correct value if I only preview and switch pages but do not zoom in and out on the detail page before I move to the summary band on the last page. But if I zoom in and out on page1 and then jump to the summary band on page2, the value of totcomcash each time I do it will double i.e., 110.00, 220.00, 330.00, ...

I can duplicate this in both VFP8 and VFP9
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform