Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Change Report Grouping on Runtime
Message
De
26/12/1996 11:39:11
Paul Wei
Fib, State of Michigan
Lansing, Michigan, États-Unis
 
 
À
19/12/1996 22:59:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00015667
Message ID:
00016003
Vues:
38
>In VFP report designer, do I have to fixed a grouping for the report format and design x number of report formats against x number of grouping? Or can I on runtime, change the Report Grouping information?
>Thanks.


Suppose you have a table called "Sales" with three fields: region, department, and sale_amount.

You can create a report listing the three fields but with a dummy grouping expression by combining the macro substitution "EVAL" function with a memory variable called cDummyGrpVar. Make your grouping expression for your report as follows:
EVAL(m.cDummyGrpVar)
Just before you invoke your "Report Form ..." command, assign the field name you want to group this particular report by to the memory variable cDummyGrpVar and the report should group on the field you have selected.

So, if you say:
m.cDummyGrpVar = 'sales.region'
report form ...
Your report will be grouped by region. If you say:
m.cDummyGrpVar = 'sales.department'
report form ...
Your report will be group by department. Pretty slick eh? Further, no reason why you can't have 3, 4, 5 ... levels of grouping expressions each with it's own dummy memory variables to really make a single report design work for you.

Paul
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform