Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GridExtras class by Craig Boyd
Message
From
10/01/2009 20:01:40
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01371947
Message ID:
01372610
Views:
24
If you just want an Excel dump, you can use

COPY TO C:\XXXXX TYPE XL5


I just use that in my code, but use GridExtra for sorting, filtering.

I think his export does more fomats, like the new XLSX.

I had some trouble with the export in GridExtras. I think it had do do with a column name in my grid was a reserved word or something.

Also, my grid was populated from a SQL statement, and I found that each time I re-built the cursor I had to drop GridExtra instance and add another instance and point it back to grid. No bid deal, and maybe there is a better way.

I have added a methods to my grid class that I can call that will add and remove a GridExtra class to the parent container of the grid. It will then point GridExtra.GridReference to itself, then it will call the GridExtra.GridSetup() method on the newly added GridExtra object. To wrap it up, I added a property on my grid class called lUseGridExtra, and if I set that .T., by grid class will handle the whole thing. I also added a method on my grid called DropGridExtra(), so I can remove it before I re-assign the recordsource, then I can call SetupGridExtra() on my grid to get back going again.

From his site, and it is this easy to use, the basic steps are:

1. Drop an instance of the gridextras onto your form or container (one gridextras for each grid you want to enhance).

2. Set the GridExtras' GridExpression property to a string that will evaluate at runtime to the grid you are enhancing - "Thisform.Grid1" is the default value for this property.

3. Call the GridExtras' Setup() method whenever your grid is ready to go. I have no way of knowing if you are setting the recordsource at runtime, or whether you are adding columns in code, so this method is provided as a way for you to control when GridExtras will begin interacting with the grid.



>>Yes. From the web site...
>>
>>AllowGridExport, AllowGridFilter, AllowGridPreferences, AllowGridSort - these properties allow you to turn certain features of the class off or on depending on your needs.
>>
>
>Great, I'll try to incorporate this class into the application during this weekend.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform