Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Convert report to excel
Message
De
15/05/2007 11:51:47
 
 
À
15/05/2007 07:40:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01225460
Message ID:
01225607
Vues:
17
>hi all,
>
>any way to convert myreport to excel sheet ,
>as
>report form myreport to excel sheet, or replace all created fileds at my report to new temporary table or cursor, and change it to excle sheet via
>
>ex..
>report form myreport to (newtable or cursor)
>**********
>use (newtable or cursore)
>gcDelimName = ALIAS( ) + '.xls'
>gcDelimFile = PUTFILE('excel_file:', gcDelimName, 'xls')
>IF EMPTY(gcDelimFile)
>   CANCEL
>ENDIF
>COPY TO (gcDelimFile) XL5
>
>thanks
I always create a cursor prior to printing.
Then you can either open a XLS and paste the cursor into it
or use a VFP report
mc excel
SELECT * FROM MyTable INTO CURSOR cc1 ORDER BY 2,1
lnRecCount=_tally

* copy to clipboard
_vfp.DataToClip(,,3)

* Specify xlt (Exel Template File)
lcTemplate=ADDBS(SYS(5)+SYS(2003))+[Excel\Templates\AR_Report2.xlt]
*lcTemplate=[]

LOCAL oExcel as Excel.Application && to make intellisense happy
oExcel=CREATEOBJECT("Excel.Application")
oExcel.visible= .F.
oExcel.DisplayAlerts = .F.

oW=oExcel.Workbooks.Add(lcTemplate)
* select sheet 1
ow.Worksheets[1].select

oRange = oExcel.ActiveSheet.Range("A6:F"+TRANSFORM(6+lnRecCount))
oExcel.selection.PasteSpecial()
* etc....
Peter
Peter Cortiel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform