Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert to excel
Message
 
À
25/04/2005 05:40:16
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 7
Database:
Visual FoxPro
Divers
Thread ID:
01007983
Message ID:
01007985
Vues:
18
Copy to XLS in VFP versions before VFP8 supports only 16000 rows.
If you have more then 16000 rows you can split the file to multiple XLS files with 16000 rows in every.
USE active1
gcDelimName = ALIAS( ) + '.xls'
gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
IF EMPTY(gcDelimFile)
   RETURN
ENDIF
IF RECCOUNT() < 16001
   COPY TO (gcDelimFile) XLS   && Create delimited file
ELSE
   gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
   cFilePath = ADDBS(JUSTPATH(gcDelimFile))
   cFileName = JUSTSTEM(gcDelimFile)
   cFileExt  = JUSTEXT(gcDelimFile)
   nFileCnt  = 1
   GO TOP
   DO WHILE .NOT. EOF()
      cTarget = cFilePath+cFileName+"_"+ALLTRIM(STR(nFileCnt))+"."+cFileExt
      nFileCnt= nFileCnt + 1 
      COPY TO (cTarget) NEXT 16000
   ENDDO
ENDIF
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform