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!

Shared Variable Array Not Working

Status
Not open for further replies.

ncpridge

Technical User
Apr 20, 2011
3
US
Hello, we have a sub-report containing the Admission number for each Account. The shared variable array in the sub-report works. However, when I try to use the following formula on the main report, it is not returning the Admission shared array defined the sub-report - it's all zeroes. I need to look-up the Account and return the corresponding Admission number. Please help! I need to figure out before Sunday.

If it matters, on the sub-report I have 1 group (Account) and the array formula is the in Group Footer. On the main report, I have 3 groups, none of which are Account, but the Account is in the details. I've placed the sub-report in the Group Header 1, and the Array is in the Details. I've tried creating a group=Account but that didn't matter.

On the Sub-Report that works:
shared stringvar array Account;
shared numbervar array Admission;
numbervar n;

n:=n+1;
redim preserve Account[n];
Account[n]:={Crystal___Liaison_Acct_Referrals.Account Name};
redim preserve Admission[n];
Admission[n]:=Sum ({@Admission equal 1}, {Crystal___Liaison_Acct_Referrals.Account Name});

On the Main report that does not work:
shared stringvar array Account;
shared numbervar array Admission;
numbervar n;
numbervar displayhelp:=0;

for n:=1 to ubound (Account) do

if
(Account[n]={Crystal___Liaison_Account_Summary.Account Name})
then
displayhelp:=Admission[n];

displayhelp
 
Try amendingthe formula in the main report to:

Code:
shared stringvar array Account;
shared numbervar array Admission;
numbervar n;
numbervar displayhelp:=0;

for n:=1 to ubound (Account) do

if	Account[n]={Crystal___Liaison_Account_Summary.Account Name}
then	displayhelp:=Admission[n]
else	displayhelp:=displayhelp;

displayhelp

Hope this helps.

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top