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

Array for email addresses in Group Header 1

Status
Not open for further replies.

ChuckGann

IS-IT--Management
Jun 16, 2004
18
US
We are using Crystal XI on a SQL2000 database. The application we are using stores email addresses related to each customer number in the database, but stores each email address related to the same customer number on a different line of data. We need to combine these in the Group Header(we are grouping by the customer number) and separate them with a semicolon. We need this for a bursting tool that handles the email through Group Header 1. An array is probably the way to go, but we are not getting any results.

Thanks for looking at this.
 
Here's one I did awhile back.... (I got this idea from TTips also.....Feel free to plagiarize it!

WhilePrintingRecords;
Shared StringVar Array DriverName;
numbervar x1;
stringvar result2;
ReDim Preserve DriverName[UBound(DriverName)+1];
for x1 := 1 to (ubound (DriverName)) do
(

DriverName[x1]:= ({tblDirectory.InternetAddress}+";"+chr(12));

result2:=result2+DriverName[x1];
exit for

)
;result2;

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
ALSO... I had to put this in the Group FOOTER.

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
Thanks for your help, but the Group Header seems to be my issue. The application we use to handle the bursting requires the data be returned to Group Header 1, and I can't seem to get it there.
 
Well, I would go ahead and put it in the Group Header, but you will have to go to the LAST Group Header 1 to see all the results.

DataDog [pc2]
If God wanted us to count in Hexadecimal, then why did he only give us A fingers?
 
If the addresses are distinct within each customer group, you might be able to use a formula like this:

(
if isnull(nthmostfrequent(1,{table.address},{table.cust})) then
"" else
nthmostfrequent(1,{table.address},{table.cust})
) +
(
if isnull(nthmostfrequent(2,{table.address},{table.cust})) then
"" else
";" + nthmostfrequent(2,{table.address},{table.cust})
) +
(
if isnull(nthmostfrequent(3,{table.address},{table.cust})) then
"" else
";" + nthmostfrequent(3,{table.address},{table.cust})
) //etc.

You would have to build in enough clauses to accommodate the maximum number of addresses per customer.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top