Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert from vfp to excel sheet
Message
 
À
26/12/2004 04:13:51
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 7
Divers
Thread ID:
00972175
Message ID:
00972189
Vues:
20
Hi Mohammed
You can convert the mytable to excel sheets with this function below.
I had the same Problem before few years.
>
>
USE moh55 
gcDelimName = ALIAS( ) + '.xls'
gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
IF EMPTY(gcDelimFile)  && Esc pressed
   CANCEL
ENDIF

Exit_In_Xls("moh55",gcDelimFile)


FUNCTION exit_in_xls

PARAMETERS source_file,xls_file
LOCAL expo_files, zik ,mm_name_part, limit_records
      SELECT (source_file) 
      all_records = RECCOUNT()
*     one row reserved for the field header    
      limit_records = 16383    && for VFP 7
*     limit_records = 65534    && for VFP 8 and higher
      m_cycle = INT(all_records / 16383) + 1  && for VFP 7
*     m_cycle = INT(all_records / 65534) + 1  && for VFP 8 and higher
    
      expo_files = ""
      FOR zik = 1 to m_cycle
          IF zik = 1
             mm_name_part = xls_file
          ELSE
             mm_name_part = ADDBS(JUSTPATH(xls_file))+JUSTSTEM(xls_file)+ "_"+ALLTRIM(STR(zik-1,10,0))+"."+JUSTEXT(xls_file)
             SKIP
          ENDIF
          IF NOT EOF()
             EXPORT TO (mm_name_part) XL5 NEXT limit_records
             expo_files = expo_files + CHR(13)+CHR(10)+ mm_name_part
          ELSE
             EXIT
          ENDIF
      NEXT
      MessageBox(expo_files, 64, "EXPORT in:")
RETURN zik && the number of .xls files
>
Vladimir Zografski
Systems Analyst
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform