veyant
5th June 2003, 15:53
Hi guys,
I am facing problen that where should i insert rprt_send() command in the script as if i insert it before close of function, it only prints the last record. but if i put it before last Endselect then it prints one record n number of time. can somebody help me in getting the problem right as where should i place rprt_send() so that it only print properly. Code is given below.
function read.main.table()
{
select tirou102.*, tiitm001.*
from tirou102, tiitm001
where tirou102.mitm>=:mitm.f and
tirou102.mitm <= :mitm.t and
tirou102.mitm = tiitm001.item
order by tirou102.mitm
selectdo
t2 = tiitm001.dsca
t3 = tirou102.cwoc
run1 = tirou102.rutm
item = tirou102.mitm
seqn= tirou102.opno
select tirou102.*
from tirou102
where tirou102.mitm = :item and
tirou102.opno > :seqn
selectdo
calculate.runtime()
endselect
| rprt_send() |it prints each rcord 10-12 times.
endselect
| rprt_send() | it prints last record only
}
function calculate.runtime()
{
if (tirou102.opno=20 and tirou102.seqn=1) then
run2=tirou102.rutm
T4=tirou102.cwoc
endif
if (tirou102.opno=30 and tirou102.seqn=1) then
run3=tirou102.rutm
T5=tirou102.cwoc
endif
if (tirou102.opno=40 and tirou102.seqn=1) then
run4=tirou102.rutm
T6=tirou102.cwoc
endif
if (tirou102.opno=50 and tirou102.seqn=1) then
run5=tirou102.rutm
T7=tirou102.cwoc
endif
if (tirou102.opno=60 and tirou102.seqn=1) then
run6=tirou102.rutm
T8=tirou102.cwoc
endif
if (tirou102.opno=70 and tirou102.seqn=1) then
run7=tirou102.rutm
T9=tirou102.cwoc
endif
if (tirou102.opno=80 and tirou102.seqn=1) then
run8=tirou102.rutm
T10=tirou102.cwoc
endif
if (tirou102.opno=90 and tirou102.seqn=1) then
run9=tirou102.rutm
T11=tirou102.cwoc
endif
if (tirou102.opno=100 and tirou102.seqn=1) then
run10 = tirou102.rutm
t12=tirou102.cwoc
endif
if (tirou102.opno=110 and tirou102.seqn=1) then
run11 = tirou102.rutm
t13=tirou102.cwoc
endif
if (tirou102.opno=120 and tirou102.seqn=1) then
run12 = tirou102.rutm
t14=tirou102.cwoc
endif
if (tirou102.opno=130 and tirou102.seqn=1) then
run13 = tirou102.rutm
t15=tirou102.cwoc
endif
if (tirou102.opno=140 and tirou102.seqn=1) then
run14=tirou102.rutm
t16=tirou102.cwoc
endif
}
As i stuck here only due to this problem.
Can somebody let me know the solution
VEYANT
I am facing problen that where should i insert rprt_send() command in the script as if i insert it before close of function, it only prints the last record. but if i put it before last Endselect then it prints one record n number of time. can somebody help me in getting the problem right as where should i place rprt_send() so that it only print properly. Code is given below.
function read.main.table()
{
select tirou102.*, tiitm001.*
from tirou102, tiitm001
where tirou102.mitm>=:mitm.f and
tirou102.mitm <= :mitm.t and
tirou102.mitm = tiitm001.item
order by tirou102.mitm
selectdo
t2 = tiitm001.dsca
t3 = tirou102.cwoc
run1 = tirou102.rutm
item = tirou102.mitm
seqn= tirou102.opno
select tirou102.*
from tirou102
where tirou102.mitm = :item and
tirou102.opno > :seqn
selectdo
calculate.runtime()
endselect
| rprt_send() |it prints each rcord 10-12 times.
endselect
| rprt_send() | it prints last record only
}
function calculate.runtime()
{
if (tirou102.opno=20 and tirou102.seqn=1) then
run2=tirou102.rutm
T4=tirou102.cwoc
endif
if (tirou102.opno=30 and tirou102.seqn=1) then
run3=tirou102.rutm
T5=tirou102.cwoc
endif
if (tirou102.opno=40 and tirou102.seqn=1) then
run4=tirou102.rutm
T6=tirou102.cwoc
endif
if (tirou102.opno=50 and tirou102.seqn=1) then
run5=tirou102.rutm
T7=tirou102.cwoc
endif
if (tirou102.opno=60 and tirou102.seqn=1) then
run6=tirou102.rutm
T8=tirou102.cwoc
endif
if (tirou102.opno=70 and tirou102.seqn=1) then
run7=tirou102.rutm
T9=tirou102.cwoc
endif
if (tirou102.opno=80 and tirou102.seqn=1) then
run8=tirou102.rutm
T10=tirou102.cwoc
endif
if (tirou102.opno=90 and tirou102.seqn=1) then
run9=tirou102.rutm
T11=tirou102.cwoc
endif
if (tirou102.opno=100 and tirou102.seqn=1) then
run10 = tirou102.rutm
t12=tirou102.cwoc
endif
if (tirou102.opno=110 and tirou102.seqn=1) then
run11 = tirou102.rutm
t13=tirou102.cwoc
endif
if (tirou102.opno=120 and tirou102.seqn=1) then
run12 = tirou102.rutm
t14=tirou102.cwoc
endif
if (tirou102.opno=130 and tirou102.seqn=1) then
run13 = tirou102.rutm
t15=tirou102.cwoc
endif
if (tirou102.opno=140 and tirou102.seqn=1) then
run14=tirou102.rutm
t16=tirou102.cwoc
endif
}
As i stuck here only due to this problem.
Can somebody let me know the solution
VEYANT