I have a order report that prints the summary lines first before it prints the detail lines. The report works fine so long as there is only one line per order.
The problem comes up when there are multiple lines for one order. Since the summary is written first before the detail only the first line in the order is included in the summary calculation. The report looks like this:
--------------------------------------------------
Order 1 total: n
--------------------------------------------------
Order 1 line 1 details: amount n
--------------------------------------------------
Order 2 total: x(this should be the sum of x+y+z)
--------------------------------------------------
Order 2 line 1 details: amount x
Order 2 line 2 details: amount y
Order 2 line 3 details: amount z
The logic of the program is such that after the initial CHAIN to find the order the summary line print is immediately called before the detail lines have a chance to get processed.
Any help would be appreciated. Thanks in advance.
The problem comes up when there are multiple lines for one order. Since the summary is written first before the detail only the first line in the order is included in the summary calculation. The report looks like this:
--------------------------------------------------
Order 1 total: n
--------------------------------------------------
Order 1 line 1 details: amount n
--------------------------------------------------
Order 2 total: x(this should be the sum of x+y+z)
--------------------------------------------------
Order 2 line 1 details: amount x
Order 2 line 2 details: amount y
Order 2 line 3 details: amount z
The logic of the program is such that after the initial CHAIN to find the order the summary line print is immediately called before the detail lines have a chance to get processed.
Any help would be appreciated. Thanks in advance.