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

Form Letter Help

Status
Not open for further replies.

psamedy

Technical User
Apr 22, 2002
60
US
I have a sql statment that returns data in the following fashion:

User_Name ID Addr1 State Plan_Type
--------------- -- ----- ----- ---------
JOE 01 L ST. NY A
JOE 01 L ST. NY B
JOE 01 L ST. NY C
JOE 01 L ST. NY D
MARK 07 M ST. PA C
MARK 07 M ST. PA B

What I'm trying to do is to create a form letter report that prints one letter per User_Name that includes all that user_name Plan Types. But instead I've created a form letter report that prints a letter for every plan_type per User_Name. So using the example above i'm getting 4 letters for Joe, when what i need is 1 letter that includes all joe's plan types. Please help, i'm stuck!?!?
 
Group by User ID and place your form letter in the Group Footer.

Use a string array variable (or a simple concatanated string variable) to accumulate the plan type information for the the user. Use that variable in the Group Footer to display the information. Reset the variable in the Group Header.

Alternatively, display the Plan Types for the user in a subreport placed in the Group Footer (the subreport can be set to display the Plan Types across using multi-column formatting option in the detail section).

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks Ido

I'm a step closer, but I don't understand how I could create a formula to accumlate the plan_type information to concatanate in my form letter if it is coming from one report field?
 
In the detail section:
----------------------------------------
WhilePrintingRecords;
StringVar ls_plans;

ls_plan := ls_plan + " " + {Plan_Type} ;
----------------------------------------

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I have the String Variable in the details section of my report, which is accumulating the plan_type information. But I'm running into trouble when i try to reset variable with every new user_id. It just continues to accumulate plan info from user to user even though i have a fromula that should reset it. Will something like this work? and do i place it in the report header?

If {ID} <> previous{ID} then
Stringvar Is_plan: = &quot;&quot;;

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top