Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group header - continued
Message
From
11/12/2003 13:28:27
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Group header - continued
Miscellaneous
Thread ID:
00858244
Message ID:
00858244
Views:
62
I am trying to do something which I thought would be simple but is proving to be elusive.

I have a tables of addresses and a table of people at those addresses. Naturally there can be more than one person at an address or no one at the address (a company without people, my boss's dream). I combine them with a SQL select including all address and people fields. SQL select is from people right join address on People.address_id = Address.address_id to assure I have addresses even if there are no people.

The resulting table is ordered by address.company,address.city, people.last_name, people.first_name.

I made the address PK 'address_id' a Data Group and print the company information in the group header. The people information (if any) prints in the detail band.

I want the Group (address) header to print at the top of the next page if there are that many people. Therefore 'Reprint group header on each page' is checked. I want the Header company name to be followed by the words " -- continued", that is "ABB Controls, Inc. -- continued".

So I set up two controls one with 'company' as the field and the other with alltrim(company) + " -- continued" as the field. The two controls overlap.

I set up a variable 'nPageNoEntryAdd', set it to calculate "Sum" but with 0 inital and 0 value to store. I then _vfp.setvar("'nPageNoEntryAdd'",_pageno) in the 'on entry' calculation of the group header for the address_id group.

I then set the print when of the 'company' control to '_pageno = nPageNoEntryAdd' and the print when of the 'company + -- continue control to '_pageno > nPageNoEntryAdd'.

I does not work. The company + -- continue control prints at the top of each new page even if the detail band (people) has not spilled over.

It is as if the SetVar is not firing 'on entry' but after.

Also (dreaded second problem in a thread but maybe trying to tell me something) if I add a control for address_id in the address group header it prints fine. If I make a varible cAddId with value to store of 'alltrim(cat) + " # " + alltrim(address_id)' I get the wrong ID printed - always the ID for the last address.

Sorry this is so long but I did not want to write the simple Title type question 'How do you add 'continued' to a header?'.
Best Regards
Don Simpson
Next
Reply
Map
View

Click here to load this message in the networking platform