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

array declaration in cr8.5

Status
Not open for further replies.

tjblaser

Technical User
Sep 1, 2005
2
US
result of a formula can not be an array
CR8.5
- record set comes in with layout part, trandate(mmddyyyy), qty
- several records per part per month
- for each part need report to show monthly columns across top (jan, feb, mar, ... total) and a total row below

my first leap into arrays in crystal, and they should be as simple as they are everywhere else. maybe i'm braindead, but shouldn't this concept work without getting a msg that a formula in header can not result in an array?

-------------------------
in header there is a formula to declare array, I tried a simple declare with a redim as well.
-------------------------
@var_init
numbervar array monthly_vol := [0,0,0,0,0,0,0,0,0,0,0,0]

-------------------------
in detail there is a formula to add detail to the proper row of the array
-------------------------
@var_evaluate
numbervar array monthly_vol ;
monthly_vol [month({transdate})] = monthly_vol [month({transsdate})] + {qty}

-------------------------
in group footer, 13 individual display variables, jan, feb, ... total
-------------------------
@jan_qty
numbervar array monthly_vol [1]

@feb_qty
numbervar array monthly_vol [2]

...

@tot_qty
numbervar array monthly_vol ;
sum(monthly_vol [1] to [12]


--------------------
then was going to clear the array for the next part number.
 
Please try inserting a crosstab before pursuing this complex approach. You should be able to use part as the row, the date as the column (click on "Order" and choose "print on change of month"), and qty as the summary.

-LB
 
The workaround to the error is to follow the array initialization with a dummy expression. This final value is the formula result instead of the array.

@var_init
numbervar array monthly_vol := [0,0,0,0,0,0,0,0,0,0,0,0];
true;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top