Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create spreadsheet from normalized data
Message
 
À
09/11/2001 16:19:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00579569
Message ID:
00579990
Vues:
26
Thanks for giving me some hints! All the support i find on UI is most useful. The code I just finished and tested is to be used in a COM project where I use VFP to create a result table and another programmer is using Delphi for presentation. After selecting data from 3 tables and created a view on selected fields, the sequence for x-tab came out like this:

*-- Use selected codes in selected sequence or use all if none is selected
IF !EMPTY(.cAnalyse)
nElm=ParseToArray(.cAnalyse,@aListe)
ELSE
SELECT DISTINCT analyse FROM x INTO ARRAY aListe
nElm=ALEN(aListe)
ENDIF
*-- create table for x-tab
ctxt='create table '+.cLokalDir+'rapport free (;
paar c(4), jrnlnr c(5), prvnr c(3),;
rekv c(6),;
sted c(2),;
pdato d(8),;
materiale c(6)'
FOR i=1 TO nElm
ctxt=ctxt+',A'+aListe[i]+' C(5)'
NEXT
ctxt=ctxt+')'
&ctxt

Select x
Goto TOP
cLast='?'
Scan
Select rapport
If x.paar+x.jrnlnr+x.prvnr <> cLast
cLast=x.paar+x.jrnlnr+x.prvnr
Append blank
Replace paar with x.paar,;
jrnlnr with x.jrnlnr,;
prvnr with x.prvnr,;
rekv WITH x.rekv,;
pdato with x.pdato,;
materiale WITH x.materiale,;
sted WITH x.sted
Endif
anxx='A'+x.analyse
* Replace &anxx with x.svar
Replace (anxx) with x.svar
Select x
Endscan
CLOSE TABLES ALL
endwith
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform