cuiwenyuan
28th December 2005, 03:32
I want to get the report like below attachment. but now i can not get the "Total Purchase Amount" value.
the report layout is below:
Layout Field Name No. Output Expression
Before.field orno 1 1
Before.field orno 2 1
Detail 1 Line=1
After.field orno 1 1
can anybody help me?
thanks in advance!
centrino81
28th December 2005, 09:57
Hi Cui,
You must need a new layout. I advise to use "after.report", and y this layout choose the option sum for the field that you want, in this case the amount.
Regards,
beginer
29th December 2005, 12:05
Hi,
If u use after.report u will get the report total.
i.e Total of Purchase Amount of range of Orders.( if range of orders is fired ).
From the design it seems as if u r printing order-wise....so if range of orders are printed together then Total of purchase amounts will be required Orderwise.
So use the sum (Aggregate Function) in Print Fields for the Amount field in the after.field(orno) layout that u currently have.
cuiwenyuan
30th December 2005, 10:58
thanks for all your rapidly reply,below is my code of Detail.1.
detail.1:
before.layout:
select fifam011.mitm :part.number, fifam011.manu :curr.manu
from fifam011
where fifam011.orno = :tdpur401.orno
and fifam011.pono = :tdpur401.pono
and fifam011.sqnb = :tdpur401.sqnb
as set with 1 rows
selectdo
selectempty
part.number = ""
endselect
select fifam002.dsca :manu.name
from fifam002
where fifam002.manu = :curr.manu
as set with 1 rows
selectdo
selectempty
manu.name = ""
endselect
curr.dat = tdpur401.odat
db.set.to.default(ttiedm100)
select tiedm100.*
from tiedm100
where tiedm100._index1 = {:tdpur401.item}
and tiedm100.indt <= :curr.dat
and (tiedm100.exdt > :curr.dat
or tiedm100.exdt = 0)
selectdo
endselect
if tdpur401.disc(1) <> 0 then
discount = tdpur401.disc(1)
else
discount = tdpur401.ldam(1)
endif
if discount <> 0 then
tot.line.g = tot.line.g - (tot.line.g*discount/100)
endif
now, i want to get the total amount of one PO,and need print the Amont part after layout of all PO Lines.
Can anybody can give me more detail on this topic. thank you again.
george7a
30th December 2005, 11:51
Hi,
As centrino81 said:Hi Cui,
You must need a new layout. I advise to use "after.report", and y this layout choose the option sum (total) for the field that you want, in this case the amount.
Regards, Check the attachment.
Another option is to do the sum it in the code and then to show the field.
I hope it helps,
- George