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!

Pass-through of a numbervar used in main report error

Status
Not open for further replies.

EMSI9988

Technical User
Jan 31, 2013
3
US
The formula in the sub-report is as follows
shared numbervar STD;
STD:= {ICILOC.STDCOST};

The main report formula @SharedSTD
shared numbervar STD;
This formula is in the Detail line
the information is correct appearing on the detail line.

the subreport is in GH1 line.

When i go to use the formula @SharedSTD in another formula @COST in the Detail line
if {OEINVD.UNITCOST} <= 0 then {OEINVD.QTYSHIPPED} * {@sharedSTD} else {OEINVD.UNITCOST} * {OEINVD.QTYSHIPPED}

As soon as I try to run the report I get the following error:
A summary has been specified on a non-recurring field
Details:mad:COST

Any thoughts ont he error would be greatly appreciated.

Bill
 
You have to precede all shared var formula with

whileprintingrecords;

Also I would declare the var in @cost rather tan refering to a formula

@COST
whileprintingrecords;
shared numbervar STD;

if {OEINVD.UNITCOST} <= 0 then {OEINVD.QTYSHIPPED} * STD else {OEINVD.UNITCOST} * {OEINVD.QTYSHIPPED}

Ian
 
Ian,

thanks for the reply. I followed your instructions and I'm still getting the same error when I try to execute the report
Error:
A summary has been specified on a non-recurring field
Details:mad:COST
 
Are you trying to summarise @Cost?

If so you can not do this, you will need another Variable

@COST
whileprintingrecords;
shared numbervar STD;
global numbervar totalcost;

if {OEINVD.UNITCOST} <= 0 then {OEINVD.QTYSHIPPED} * STD else {OEINVD.UNITCOST} * {OEINVD.QTYSHIPPED}

if {OEINVD.UNITCOST} <= 0 then totalcost:= totalcost+{OEINVD.QTYSHIPPED} * STD else totalcost:= totalcost+{OEINVD.UNITCOST} * {OEINVD.QTYSHIPPED};

Where you are using your @cost summary use

@display TotalCost
whileprintingrecords;
global numbervar totalcost;

Ian





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top