Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
[Print When] for Group Bands?
Message
From
14/09/2004 23:16:45
Al Doman (Online)
M3 Enterprises Inc.
North Vancouver, British Columbia, Canada
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00942044
Message ID:
00942234
Views:
19
Hi Cathy,

I think I'm already doing something similar. When I build the report-driving cursor I set up and populate generic columns cBreak1, cBreak2, etc. and then INDEX or SELECT it to get the records in the right order.

I haven't totally thought it through but I think if you have say, 2 detail bands built-in to the report, even if you suppress printing of any label in the 2nd Group Header band, the blank height of that band will still print. Also, I'm going to need the Group Footers for report calculations and I'm not sure the subtotals would come out right if I did something like this.

With the generic approach I currently use I design the report with the most grouping levels (ReportN). After I save that, I strip out the deepest grouping level and save that as Report(N-1) and repeat until the group bands are all gone. Typically no other changes are needed so it doesn't take that long. However, since this report can be grouped up to 7 deep I thought I'd ask if anyone has a better idea ;) Thanks for taking a look at this.

>You can make the group expressions dynamic by using EVALUATE(). Maybe this will help you do what you want. For example, set the data group expression of the first group to: EVALUATE(cExpression1). Then set the data group expression of the second group to: EVALUATE(cExpression2) ... and so on.
>
>In code, do this:
>
>
>IF {some condition}
>  cExpression1 = 'customer.state'
>  cExpression2 = 'customer.custid'
>ELSE
>  cExpression1 = 'customer.state'
>  cExpression2 = '""'
>ENDIF
>REPORT FORM MyReport ...
>
>
>The above code would make the report break on State -- then Customer ID for the first condition. Otherwise, it only breaks on State, never anything else because the second expression always evaluates to the same thing for every record in the report.
>
>I hope this helps,
>Cathy
>
>
>
>
>
>>VFP5
>>
>>I've got a report, where the user may choose to group the detail records by up to N levels, or not group them at all. In the past, I've handled this by creating (N + 1) reports and then selecting the right report at run time e.g. Report0 (with no Group bands) if no grouping selected, Report3 (with 3 Group bands) if 3 grouping levels selected, etc.
>>
>>What I'd like to do is create just a single report with the maximum number of grouping levels (i.e. "ReportN"), and suppress any group bands that may not be necessary for a given report run. Can anyone think of a way to do this? I'd rather not hack the .FRX unless it's fairly straightforward; for me it would probably take no more effort than building N reports.
>>
>>We have a "Print When" option that lets us optionally print fields in a detail band. Is there any way to implement something similar for Group bands?
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform