Crystal Reports 10
First and Last names are part of different lines of detail, and I'm trying to use three StringVar formulas to create a "FirstName LastName" field in the Group Footer where I group on CUSTOMER_ID.
Sample Data and Formulas are below....
CUSTOMER_ID,FIELD_ID,INPUT_VALUE
1,1,JOHN
1,2,SMITH
1,3,416-123-4567
1,4,TORONTO
1,5,ON
2,1,BOB
2,2,JONES
2,3,613-123-4567
2,4,OTTAWA
2,5,ON
GROUP HEADER
============
Name: {@RESET NAME VAR}
Formula: Global stringVar NAME := "";
DETAIL
======
Name: {@ADD NAME VAR}
Formula: Global stringVar NAME;
IF {CustomerInfo_txt.FIELD_ID} in [1,2] THEN stringVar NAME := NAME + {CustomerInfo_txt.INPUT_VALUE} + " " ELSE stringVar NAME := NAME;
GROUP FOOTER
=============
Name: {@DISPLAY NAME VAR}
Formula: Global stringVar NAME := NAME;
When I run the report, the StringVar is NOT RESETTING the variable in the Group Footer, so the string just keeps growing with each name.
CUSTOMER_ FIELD_ INPUT_VALUE
1
1 1 JOHN JOHN
1 2 SMITH JOHN SMITH
1 3 416-123-4567 JOHN SMITH
1 4 TORONTO JOHN SMITH
1 5 ON JOHN SMITH
2
2 1 BOB JOHN SMITH BOB
2 2 JONES JOHN SMITH BOB JONES
2 3 613-123-4567 JOHN SMITH BOB JONES
2 4 OTTAWA JOHN SMITH BOB JONES
2 5 ON JOHN SMITH BOB JONES
I'm pretty sure the issue is with the way I am declaring the StringVar. Anyone have an idea of what I am doing wrong..?
Thanks in advance for the advice.
First and Last names are part of different lines of detail, and I'm trying to use three StringVar formulas to create a "FirstName LastName" field in the Group Footer where I group on CUSTOMER_ID.
Sample Data and Formulas are below....
CUSTOMER_ID,FIELD_ID,INPUT_VALUE
1,1,JOHN
1,2,SMITH
1,3,416-123-4567
1,4,TORONTO
1,5,ON
2,1,BOB
2,2,JONES
2,3,613-123-4567
2,4,OTTAWA
2,5,ON
GROUP HEADER
============
Name: {@RESET NAME VAR}
Formula: Global stringVar NAME := "";
DETAIL
======
Name: {@ADD NAME VAR}
Formula: Global stringVar NAME;
IF {CustomerInfo_txt.FIELD_ID} in [1,2] THEN stringVar NAME := NAME + {CustomerInfo_txt.INPUT_VALUE} + " " ELSE stringVar NAME := NAME;
GROUP FOOTER
=============
Name: {@DISPLAY NAME VAR}
Formula: Global stringVar NAME := NAME;
When I run the report, the StringVar is NOT RESETTING the variable in the Group Footer, so the string just keeps growing with each name.
CUSTOMER_ FIELD_ INPUT_VALUE
1
1 1 JOHN JOHN
1 2 SMITH JOHN SMITH
1 3 416-123-4567 JOHN SMITH
1 4 TORONTO JOHN SMITH
1 5 ON JOHN SMITH
2
2 1 BOB JOHN SMITH BOB
2 2 JONES JOHN SMITH BOB JONES
2 3 613-123-4567 JOHN SMITH BOB JONES
2 4 OTTAWA JOHN SMITH BOB JONES
2 5 ON JOHN SMITH BOB JONES
I'm pretty sure the issue is with the way I am declaring the StringVar. Anyone have an idea of what I am doing wrong..?
Thanks in advance for the advice.