Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting users some control
Message
 
 
À
01/02/2002 11:04:59
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00614042
Message ID:
00614287
Vues:
19
>Nadya,
>I don't know about the form, but for reporting you could use the QuickReport() function (see Message #597306). I use this all the time. If formats and sends the content of the currently selected table/cursor to Excel using automation. The real added value of this function is that it correctly adjusts the column widths according the data and it takes advantage of Excel's "Fit to Page" feature. It's also very easy to customize the format if you don't like it.

Here is a new description for this program. I'm not sure, when you created it, so I placed a date from the referenced UT message. Note, if you want to respond, delete this text or remove PRE tags, because currently UT color parser has some problems:
************************************************
*) Author............: Daniel Gramunt
*) Created...........: 12/21/2001 && This is the date from UT message
*) Description.......: Formats and sends the content of the currently selected
*)                   : table/cursor to Excel using automation.
*)                   :
*)                   : The following modes are suppored:
*)                   :
*)                   :   1 = ToExcelNoShow
*)                   :   2 = ToExcelPreview
*)                   :   3 = ToPrinterNoShow (Excel file deleted)
*)                   :   set sysmenu to default
*)                   :   4 = ToExcelNormal && Nadya Nosonovsky 02/01/2002 04:05:14 PM
*)                   : 
*)                   : Returns: Numeric
*)                   :          0 if successful
*)                   :
*)                   :          If Error occurred:
*)                   :          -1 Parameter missing or invalid value
*)                   :          -2 Parameter missing or wrong type
*)                   :          -3 No table open in current work area
*)                   :
*  Calling Samples...: QuickReport(1, "c:\temp\customers.xls") && ToExcelNoShow
*                    : QuickReport(2)                          && ToExcelPreview
*                    : QuickReport(3)                          && ToPrinterNoShow
*                    : QuickReport(4)                          && ToExcelNormal 
*)                   : If you want to launch it from a menu, 
*)                   : you could add something like this to your startup.prg:
*)                   : Print currently selected table to Excel
*)                   : DEFINE BAR 3 OF DevTools PROMPT "Print Table to Excel" SKIP FOR EMPTY(ALIAS())
*)                   : ON SELECTION BAR 3 OF DevTools DO QuickReport(2)
*  Parameter List....: tnMode       - See above
*                    : tcOutputFile - Excel output file. Required for ToExcelNoShow mode
*  Major change list.:
*  Minor change list.: Nadya Nosonovsky added ToExcelNormal mode and fixed bug when table used under different alias
*-------------------------------------------------------------------------------------------------------------------
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform