Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert to excel book
Message
De
09/09/2005 11:08:51
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8
Database:
Visual FoxPro
Divers
Thread ID:
01048102
Message ID:
01048146
Vues:
36
hi,
thank you very much for reply ,a dvice , site and explaine

not much data to push .

anyway thank you again.

best regards
m.qasem

>Mohammed,
>
>VFP doesn't have a command that will export to worksheets of a workbook directly. You will have to use the Excel Automation interface to get this to work.
>
>oExcel = createobject( "excel.application" )
>oExcel.Visible = .t.
>
>You will have to loop through generating each of the three cursors individually. If you don't have too much data to push into the spreadsheet you can iterate over your cursor and set individual Cell().Values to the correct column.
>
>If these spreadsheets are really large it'll perform much faster to just output each cursor to a CSV file and use automation to read each CSV into the current page.
>
>I don't have any other sample code fragments handy at the moment I'll post them a little later. In the meatime you might start looking at the Excel automation help file. It will be named something along the lines of C:\Program Files\Microsoft Office\Office10\1033\VBAXL10.CHM but the location and actual file name depend on the version of Excel you are using. Also it's an optionally installed component so if you don't find it you will have to run the Office setup and add these help files. You can also find the documentation on the web at http://msdn.microsoft.com/office/
>
>>any help idea ,to store(convert) this data via vfp code to 3 sheets at my xls.book
>>as.
>>"ADSL 1 " and all fields at one sheet1
>>"B ISDN " ----------------------sheet2
>>"LL " ----------------------sheet3
>>
>>
>>Select * from am ;
>>  where INLIST( val(char3), 100, 201, 202, 203 );
>> and ( inList( upper(allt(telno)), "ADSL 1", "B ISDN  ") or upper(left(telno,2)) = "LL" );
>>   into table am2 nofilter
>>
>>
>>CLOSE all
>>USE am2
>>
>>gcDelimName = ALIAS( ) + '.xls'
>>
>>gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
>>
>>IF EMPTY(gcDelimFile)  && Esc pressed
>>
>>   CANCEL
>>
>>ENDIF
>>
>>COPY TO (gcDelimFile) FIELDS char1 ,char3 , char7, char8, char9, char13 ,telno, char26, char27, char28   XLS
>>
>>DROP TABLE am2
>>
>>
>>thanks.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform