>Thanks alot. I am a really dumby. You have been a tremendous help!
>My goal is to print out several foxpro tables to a neat looking format through excel via ole automation. In a VFP5 report, I am unable to print more than one table (not linked) in each report. That is the reason for my endeavour do achieve it with excel. Do you know of a way I could print more than one table in a nice format with table borders and table gridlines and blank space between tables on a single report?
>Your help is greatly appreciated!
>Thanks
Create an array of the VFP table names to be exported and try something like this:
lnRow = whatever row you want to start
howmanytables = ALEN(TableArray)
FOR i = 1 TO howmanytables
SELECT 0
USE TableArray(i)
GO TOP
* Populate the worksheet with the VFP data
SCAN
.Cells(lnRow,1).Value = TableArray(i).FirstFieldName
.Cells(lnRow,2).Value = TableArray(i).SecondFieldName
.Cells(lnRow,3).Value = TableArray(i).ThirdFieldName
lnRow = lnRow + 1
ENDSCAN
* Skip a line between VFP tables
lnRow = lnRow + 1
ENDFOR
Hope this helps
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement