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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal 10 variables 1

Status
Not open for further replies.

ChristianWhite

Programmer
Jun 14, 2004
41
US
In Crystal 10, I'm trying to print some detail headings in the detail lines, since having all the report's headings in the page header would be a traffic jam at page top. I'm trying to print detail headings only at their first occurrence on each page.

In the page header, I set the variable true at each new page:
Global booleanvar blnPrintHeading:=true;

The suppress formula in details a (detail headings) will refer to blnPrintHeading to determine when to print.

At each detail line b (amounts), I'll set the variable false:
Global booleanvar blnPrintHeading:= false;

Problem, though: I can't declare the variable in the page header and set it true, then also reference it from a detail line formula and set it false. Whenever I change one instance of the variable, the other changes to match it. What am I missing to make this simple arrangement work?
 
An easier approach would be to create a formula for the page header:

//{@reset}:
whileprintingrecords;
numbervar x := 0;

Then add the following formula to your detail_a section:
//{@cntwinpage}:
whileprintingrecords;
numbervar x := x + 1;

Then go to the section expert->detail_a->suppress->x+2 and enter:

{@cntwinpage} <> 1

-LB
 
Thanks for that solution. I had been having a problem because I was trying to change the same global everywhere, not formulas. After seven or eight changes, I'd felt like I was on a merry-go-round. Thanks very much!



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top