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

Trying to Display Unique Client Names

Status
Not open for further replies.

mgallot

MIS
Jan 22, 2001
93
US
Using CR XI2 going to a universe. The main report has a parameter display page in the report header. The parameter is Client Name and can be a wildcard search by name or client number. The user wants the actual Client Names that the search found to be display in the report header. Join doesnt work, it only shows one record.

So I created a subreport that passes the Client Name parameter and then selects only the relevant records. I only need to display unique client names on the report so I have these formulas setup.

//{@accum} for the detail section:
whileprintingrecords;
stringvar name;
if
not({CAU_Client.Client Name} in name) then
name := name + {CAU_Client.Client Name} +",";

//{@display} for the group footer:
whileprintingrecords;
stringvar name;

//{@reset} for the group header:
whileprintingrecords;
stringvar name;
if not inrepeatedgroupheader then
name := "";

The output is showing each Client Name as many times as there are details records though, so the unique part isnt working. What am I doing wrong?

Thanks.
 
These formulas would return a unique list of names in the group footer. I think you should confirm that you have placed these in the correct sections and then look at the detail accumulation formula to see what's going on. Is there some variation in the name per row, e.g., with an initial with a period or not?

Please show a sample of the detail section that shows how the accumulation formula is displaying.

-LB
 
Oh boy, its working now. I dont know what I changed. But the list is going vertical with one name on each line. So there is an issue in the Display field.

 
In the accumulation formula, did you use chr(13) instead of the comma? Or is the display formula formatted to "can grow" but sized too narrowly so that it forces returns?

-LB
 
Both the Accum and the Display span the width of the page. I changed the comman to chr(13) but nothing changed. The Accum data in the detail section looks like this:

Adelphi University
(blank line)
(blank line)
(blank line)
Bucknell University
(blank line)
Carroll University
(blank line)
(blank line)

There is just one Client Name on each line, then varying number of blank lines.

Thanks for you help.
 
I'm not clear anymore on how you want this displayed in the group footer. I wasn't asking you to change to chr(13)--that would create the single column, and I thought you wanted it like:

ABC, DEF, GHI

-LB
 
You are right about how I want it displayed. I went back to the comma. I just need to get rid of the blank lines.
 
You should just be suppressing the accum formula and/or the detail and group header section if you don't need it for anything.

-LB
 
I am suppressing the group header (reset formula location) and the details (accum formula location) sections.

The group footer is displayed with the Display formula, but just one Client Name shows on each line.
 
Actually, you shouldn't be using a group for the subreport (which should be in the report header and unlinked). Remove the reset formula, and just show the display formula in the subreport footer. Format the display formula to "can grow".

-LB
 
Its works perfectly now after I removed the group.

Thank you!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top