Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Frx2Excel
Message
 
À
24/08/2002 14:25:00
Cindy Winegarden
Duke University Medical Center
Durham, Caroline du Nord, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00693094
Message ID:
00693318
Vues:
18
A method we are using is to use an excel macro stored in a memo field of the report table. An advantage of this approach is that you can record a macro in excel while you are connecting to your data (msquery) and formatting the spreadsheet. When you have the spreadsheet as you want it you can stop recording the macro, cut the macro and paste it into your reports table memo field. Then when a user goes to send the report to excel you can use some code such as the following:

select macro from (this.reports) where keyword = (this.keyword) into cursor (this.tempcursor1)
select (this.tempcursor1)
lcMacFile = myapp.main_folder+'DATA\Mac_text.txt'
=strtofile(macro,lcMacFile)
oMacMod=oExcel.Modules.Add()
oMacMod.InsertFile(lcMacFile)
ERASE (lcMacFile)
oExcel.run("Macro1")


>>I know the class Frx2Word, but, dont exist Frx2Excel?
>
>Mario, I don't think anyone has written such a thing but here's some suggestions if you don't want to try to exactly duplicate a VFP report in Excel:
>
>If you SELECT all your data into a report cursor, why not automate Excel, open a spreadsheet, use _VFP.DataToClip(,,3) to pick up the data, and oExcel.Paste(). You can go a little further to spread out the columns, boldface the first line where the column titles are, etc.
>
>Excel has a nice subtotal function. You can write some code to create subtotals after you've pasted in the data.
John Campbell
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform