Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Variable Help...

Status
Not open for further replies.

nlaliberte

Programmer
Apr 26, 2007
79
US
I'm using Crystal XI.

I'm trying to use a variable to govern whether or not a group header appears on the next page with "(continued)" next to it. Basically the report is an activity log, with the activities being long strings that tend to run onto the next page. Our user would like the contacts name to appear again on the next page with the activity with "(continued)" next to it when this occurs.

What I have is a group for each activity, with the header set to repeat on each page. This works great but there is no "(continued)" next to it. So I created a simple variable that will be a 1 or a 0. I set it to 1 in Detail Section A;

shared numbervar mid_detail;
mid_detail := 1


And then have a Detail Section B in which it's set to 0 again;

shared numbervar mid_detail;
mid_detail := 0


My logic being that if a page starts and the variable is at 1 than an activity has wrapped to the new page and "(continued)" should appear. However when I put a debug object in the group header to show me what the variable is set to I find that it's always set to 0 no matter whether Detail Section B has run yet or not.

Does anyone know why these variables being set in the Detail Section are not having an effect on the variable's value in the Group Header? Any suggestions?
 
Hi,

A simpler solution: put a text box in the group header with the text 'Continued', and suppress it on condition <not inrepeatedgroupheader>. The group has to be set on Repeat Group Header On Each Page.

Dana
 
The Detail B will always run before your next group header, move your

shared numbervar mid_detail;
mid_detail := 0

To Group footer.

Ian
 
Ian,

I'm not sure why but this isn't working either. I went back and looked at an old report and that's how I was doing it, turn it on in the details, off in the group footer. However I can't seem to get that to work on any other report, very frustrating.

ianoctdec that is a much easier solution and works great. Was not aware of that function. Thank you very much that makes things much easier.
 
Or instead of using a text box, you could create a formula like this:

if inrepeatedgroupheader then
{table.groupfield} & " (Continued)" else
{table.groupfield}

Remove the groupname and add this formula to the group header instead. Does the same thing as the text box, so the only real value is that I think items in text boxes take longer to process.

-LB
 
Also an improvement on how I'm doing it...

Thanks one more time MVP :) haha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top