Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP ole Excel question
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00259234
Message ID:
00261596
Views:
45
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform