I have a main report that displays by material number:
Avg Cost
Amt Allocated
Total Allocated Cost
With a SUM of total allocated cost in the report footer.
In the report footer I have a sub-report that displays by material number:
Avg Cost
Amt On-hand
Total On-hand Cost
With a SUM of total on-hand cost in the report footer.
I need to get the SUM of total on-hand cost from the sub-report to the main report. I have tried using a shared variable with the following code:
@Sum_TotCst
WhilePrintingRecords ;
Shared currencyVar Sum_TotCst ;
If {ssinvent.uomcost} = 'M' Then
Sum_TotCst := Sum_TotCst + (({ssinvent.onhand} * {ssinvent.avgcost}) / 1000)
Else
If {ssinvent.uomcost} = 'CWT' Then
Sum_TotCst := Sum_TotCst + (({ssinvent.onhand} * {ssinvent.avgcost}) / 100)
When I put @Sum_TotCst in the RFb it only shows the value of the last total on-hand cost. Why isn't it summing? I don't declare this variable anywhere in the report so it isn't accidently getting cleared.
TIA,
Rena
Avg Cost
Amt Allocated
Total Allocated Cost
With a SUM of total allocated cost in the report footer.
In the report footer I have a sub-report that displays by material number:
Avg Cost
Amt On-hand
Total On-hand Cost
With a SUM of total on-hand cost in the report footer.
I need to get the SUM of total on-hand cost from the sub-report to the main report. I have tried using a shared variable with the following code:
@Sum_TotCst
WhilePrintingRecords ;
Shared currencyVar Sum_TotCst ;
If {ssinvent.uomcost} = 'M' Then
Sum_TotCst := Sum_TotCst + (({ssinvent.onhand} * {ssinvent.avgcost}) / 1000)
Else
If {ssinvent.uomcost} = 'CWT' Then
Sum_TotCst := Sum_TotCst + (({ssinvent.onhand} * {ssinvent.avgcost}) / 100)
When I put @Sum_TotCst in the RFb it only shows the value of the last total on-hand cost. Why isn't it summing? I don't declare this variable anywhere in the report so it isn't accidently getting cleared.
TIA,
Rena