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

whileprintingrecords; 2

Status
Not open for further replies.

sim133

Technical User
Sep 14, 2004
85
US
Hello everyone;
I have this code that prints business naics codes (business services code). The problem I am having is it keeps concatenating the codes created in the first grouping to the next, and next, and next grouping. Is there anyway to reset nics variable when it starts a new grouping. The report is grouped by business IDs; Below is the code.
Code:
whileprintingrecords; 
stringvar nics;
nics := nics + {VENDOR_NAICS.NAICS_CODE} + ", ";
 
Create another formula that resets it and place it in the group header:

Code:
whileprintingrecords; 
stringvar nics := "";

~Brian
 
Be careful of the last formula if you are also repeating the group header on every page. If this is the cast the header will print again and reset the value of the variable.

To get around this, modify the formula slightly:
Code:
WhilePrintingRecords; 
If Not InRepeatedGroupHeader then stringvar nics:="";

This will have the effect of resetting the variable only once at the beginning of each group, regardless if the group header is repeated in the group.


Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"making predictions is tough, especially about the future" - Yogi Berra
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top