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:
00463801
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

I have had lots of requests for it, but haven't had time to do it. I don't think it would be hard, if you are willing to live with these limitations:

1. Only detail lines will be exported. (You probably want to skip constants as well.) No page headings. No breaks. No group headers and footers.

2. No report variables are needed.

Actually, you can work around these; it just takes a little more effort. So here is what you have to do to write a program to do this automatically. THe program needs to:

1. Open the FRX and extract expressions from the detail band. I'm not quite sure how to determine what is in the detail band. You need to look at VPOS (vertical position) value.

2. Build a cursor with field names A001, A002, etc.; one for each expression.

3. Scan thru your data file. For each record add an empty record into your cursor. Now loop thru your expressions. Evaluate each and put the result into the appropriate cursor field.

4. Create the Excel file from the cursor using the Foxpro COPY TO command.

Voila! A good day's work, and you have a generic routine. You can enhance it later to handle variables and so forth.
Tom Green in Montreal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform