Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to export a report to Excel format ?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00463333
Message ID:
00463635
Vues:
13
>Hi all,
>
>Can anyone know how to export a report to Excel format ?
>I wonder if there is a third party VFP class, such as frx2word.vcx.
>
>Thanks,
>
>Samuel



NO direct export!

Possible way to do:
A) Make an Excel "Template", with complete report outlook.
Then Create an Excel Object and using Scan.. EndScan LOOP
to fill in blanks with approiate Excel Macro Command..
All tasks are done in VFP.

Or
B) Make an Excel "Template", with complete report outlook.
Export the Report Cursor to excel file by simply Copy cmd in other post..
At Excel, design a Button and make a serial of macros to fill in blanks

This is only time-consuming, you must be able to do!
Making Template to handle the outlook and position
is ALREADY save you time to do it in blank worksheet!

The way to calculate how many columns in Excel needed it fit fill the report is the most complex task.
For winword, Only Consider the Tab position per line would be more easy way to do!

But if you make a template for it, the coding for fill in blanks would be less a lot!

For A)
Pseducode would be sth like that:
Select ReportCursor
Create an Excel Object
Create a File with the pre-defined template
Scan
oExcelObject: Copy the pre-defined Worksheet To New page
oExcelObject: Rename the new page with correspond Name (e.g. Item #)
oExcelObject: Fill in blanks with assign value to those field (e.g. B3 for Item #)
EndScan
What you need to do is check all the correct macros commands from pseducode,
The complete coding maybe less than 50 Line of code,
No one will feel that it is too difficult to do unless you are lazy!

It takes about 2-3 days for first report,
then about 2-3 hrs for next report, just modify report outlook need much time then adjust VFP coding.

For me, I do similar thing but it is a WinWord Fax heading.
Since most fax detail will be done later, make report and frx2word will be more waste time for me..
Thus, I do it by direct coding control.
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform