Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cumulative value as a coulumn
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00557686
Message ID:
00557703
Vues:
7
Hi!

You can do this 2 ways.

1. Create custom function or form method that will return required value, and put that function into the expression for the column ControlSource. This can slow down the grid displaying in case this function works slowly, specially it will be slow when some index used for main table displaying in some sorting order.

2. Create a temporary cursor which holds all values for main data, recno() from main data is appropriate to recno() in that cursor. Display value from the cursor using simple lookup by recno(). OR link these table by ID value using SET RELATION, that will allow also sorting of main table. When you have some sorting for main table, you will require to re-calculate the values in the cursor each time sorting order is changed.

HTH.

>I have a Variable which holds a Balance figure
>I have a grid which has value columns
>I want to show a cumulative reducing balance e.g.
>
>MyBalance = 300
>
>MyTable is as follows:
>Rec 1 10
>Rec 2 3
>Rec 3 4
>
>I want to display:
>
>Rec no. Val Cum Balance
>------ ---- -----------
>Rec 1 10 290
>Rec 2 3 287
>Rec 3 4 283
>
>
>I know I can do this with a View but the Source Table can be huge (Hundreads of thousands of records) and I would prefer, if possible, to show the original table with the cumulative coulmn
>
>Regards,
>
>Gerard
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform