Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How many grid on the form ?
Message
 
To
10/09/2008 16:21:38
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01346470
Message ID:
01346525
Views:
8
Hi,

>i want to know how to have the number of grids on a form.

Is the question how many grids you can have on a form or how to find out how many grids you currently have? In the first case, you can have grids showing 32768 different cursors. You can have more grids than that, but they will show the same cursor. To find out how many grids you have you need to recursively go through all controls on the form and check the BaseClass property. Check out the Controls collection for the recursion.

>if there is one grid, i want to export to excel only fields that are on the grid.

Depends on how sophisticated you need this feature to be. The easiest case would be to create a SELECT statement using RecordSource for the FROM clause and all ControlSources for the field list. Then use COPY TO to copy this to Excel. You could also use automation or generate XML to keep formatting and data types. In addition you could evaluate the order, header and column width to persist the current layout. You could also evaluate the current index to keep the sort order. For generic solutions you additionally might have to deal with different recordsource types and columns that do not have a controlsource or use Dynamic properties extensively.
--
Christof
Previous
Reply
Map
View

Click here to load this message in the networking platform