Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Change Report Grouping on Runtime
Message
From
26/12/1996 11:43:49
Paul Wei
Fib, State of Michigan
Lansing, Michigan, United States
 
 
To
26/12/1996 11:39:11
Paul Wei
Fib, State of Michigan
Lansing, Michigan, United States
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00015667
Message ID:
00016005
Views:
39
>>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.

Let me try this again to see if I can get the formatting right:

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
Previous
Reply
Map
View

Click here to load this message in the networking platform