Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Saving cross tab data back to original file
Message
De
19/11/1999 08:32:56
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/11/1999 07:58:29
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00292953
Message ID:
00292969
Vues:
24
>Hi all-
>
>I have a grid in which the rowsource is r/w cursor which is the result of running cross tabs, i.e. each cell in the grid belongs to a different record, and the totals for rows & columns are calculated, not saved.
>
>What is the best way to save the data back to the original table? The users will be able to add and delete rows and modify individual cells. I also need the ability to revert. So far, I am considering assigning a different controlsource to each textbox in each grid cell. Any other ideas?
>
>Carlie


Carlie,
AFAIK you cannot assign a different controlsource to each cell (unless you do lengthy tricky container usage).
Cross tabs are generally result of consolidated data. If no consolidation exists then reverting back is easier. What I mean :
-You have partnames, customer_sold and quantity.
-You do a select with a grouping on partnames, customer_sold
-You do crosstab partnames as row, customer_sold columns and quantity data
-In this scenario where would edited sum_quantity for partname "A", customer_sold "ALFKI" go in original table.
-Just for the table it's created from no problem. VFPXTAB.PRG uses an intermediate array while creating unique fieldnames for columns. You would also use it to get real fielddata from columname. That's combined by row data would point to correct record in the table it's created from.

Your grid would then have controlsource as usual. You could presave the correct field data to columns(i).tag. Then only a save method would combine rowdata (field(1)) with columns(i).tag to locate the target record in original.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform