Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Macro/name substitution
Message
De
01/12/1998 12:52:33
 
 
À
01/12/1998 12:37:42
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00162838
Message ID:
00162850
Vues:
22
>I have designed a report in which I want to use macro/name substitution for the fields. The actual field names in the .dbf are faciltime1, faciltime2,...faciltime12,drrtime1, drrtime2,...drrtime12, etc. I use m.rptfield1, m.rptfield2,...m.rptfield12 as the memvars which will be used for the substitution. For example, m.rptfield1 = 'faciltime1', etc.
>
>The problem I am having is that I keep getting error messages when i run the report. If I use the format &m.rptfield1 in the report, I get the message there is a syntax error. If I use (m.rptfield1) the report displays the first few letters of the field name, for example, "facil". Only when I use the actual name of the field in the .dbf do i get the proper results.
>
>My objective in using macro/name substitution is to eliminate the need to create 10 separate reports, all of which use the same format, but each of which uses a different field in the .dbf.

Instead of macro substitution or name expansion, use an EVAL() clause:

EVALUATE(m.rptfield1)

returns the value of the expression contained in the variable rptfield1. This can be a field name, variable name, 0or an expression, so it leaves you with considerable flexibility; for example, rptfield1 could be a simple field expression, like faciltime1 or an expression like SalesTotal+TaxAmount.

>
>Any help will be appreciated,
>
>Alan Zaben
>cancer_survivor@yahoo.com
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform