I have a report where I'm passing the value of a shared variable from a subreport to the main report and it's working as expected... almost every time... the only problem I'm seeing is in the very first record of the main report, in this case the shared variable seems to be blank. Here's a description of what I'm doing:
I have to report the total quantities for every item picked from our distribution center in a given day, this data is displayed on my main report. On my subreport I'm displaying any quantities of the item that may or may not have been returned to stock on account of a customer cancelling the order.
GH1 {Item Number}:
- Subreport (put here only for the purpose of pulling the variable value to the main report, the subreport is actually minimized, not suppressed).
The subreport contains this formula (@Returned)
whileprintingrecords;
shared numbervar ReturnedQty;
ReturnedQty:=Sum ({Returned Quantity},{Item Number})
GF1:
- Summary: Sum({PickQty}, {Item})
- Formulas @ReturnedQty and @ResetReturnedQty
@ReturnedQty
whileprintingrecords;
shared numbervar Returned;
ReturnedQty;
@ResetReturnedQty
shared numbervar ReturnedQty;
ReturnedQty:=0
This is working fine every time except when for the very first record of the main report there happens to be a returned qty. The returned qty should be displayed on the main report but instead it's showing as blank.
Here's a sample of what I'm seeing:
Item Pick Qty Return Qty
123 10
124 5 9
125 6
126 5 10
When it should be:
Item Pick Qty Return Qty
123 10 2
124 5 9
125 6
126 5 10
I have to report the total quantities for every item picked from our distribution center in a given day, this data is displayed on my main report. On my subreport I'm displaying any quantities of the item that may or may not have been returned to stock on account of a customer cancelling the order.
GH1 {Item Number}:
- Subreport (put here only for the purpose of pulling the variable value to the main report, the subreport is actually minimized, not suppressed).
The subreport contains this formula (@Returned)
whileprintingrecords;
shared numbervar ReturnedQty;
ReturnedQty:=Sum ({Returned Quantity},{Item Number})
GF1:
- Summary: Sum({PickQty}, {Item})
- Formulas @ReturnedQty and @ResetReturnedQty
@ReturnedQty
whileprintingrecords;
shared numbervar Returned;
ReturnedQty;
@ResetReturnedQty
shared numbervar ReturnedQty;
ReturnedQty:=0
This is working fine every time except when for the very first record of the main report there happens to be a returned qty. The returned qty should be displayed on the main report but instead it's showing as blank.
Here's a sample of what I'm seeing:
Item Pick Qty Return Qty
123 10
124 5 9
125 6
126 5 10
When it should be:
Item Pick Qty Return Qty
123 10 2
124 5 9
125 6
126 5 10