Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Scrambled Groups
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
01340458
Message ID:
01340998
Views:
12
>>My report has 2 groups. There is one inside group where the details run to the end of the page and the group footer is on the following page. The problem is that the group header for the following group prints ahead of the group footer for the first group.
>>
>>Does anyone know how to fix this?
>>Thanks.
>
>You have stumbled onto a known bug (and one that really ticks me off!!). If the group header is marked to reprint on subsequent pages .. it does .. but the report writer has incorrectly moved the record pointer to the next record so any data you try to print from the table/cursor is the wrong information. The workaround is to create report variables for each field you want to print in the group header. However, you can't just print the report variables because the first time the group header prints, the report variables haven't been set yet because the first detail band hasn't been processed yet and that's when the report variables get set. So you have to pull further tricks by counting the records printed for a group and printing the table data for the first time .. and then the report variable for subsequent times in the group header using IIF(firsttime, table.field, reportvariable) ... or separate fields with print when logic.
>
>Read my blog here:
>http://cathypountney.blogspot.com/2007/12/gotcha-workaround-for-data-group-bug.html

Hi again.
Your explanation on this page was clearer and I was able to give it a try. But something is still weird.
I created 2 variables.

rcLead
expression = lead
initial value = lead
reset on lead
calc type = none

rcLeadCount
expression = lead
initial value = 0
reset on lead
calc type = count

Then I created 2 objects in the group header.
The first with expression = lead and PRINT WHEN = (rnLeadCount = 0).
The second with expression = lead + " Cont . . ." + transform(rnLeadCount".
The second PRINT WHEN = (rnLeadCount > 0).

The group footer On Exit contains: _vfp.setval(rnLeadCount,0)

The result is that the first obj prints on the first page of the report and the second prints on every other page. (The group starts on a new page.) This is so even when the content of the second obj shows the value of rnLeadCount is 0. Apparently the PRINT WHEN is not working after the first page or the value of rnLeadCount is changing between the time it is evaluated for the PRINT WHEN and the text output.

Does this make any sense?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform