shrikantc
28th January 2004, 09:14
Can I prevent printing of lines, on a veriable value which calculated at after detail layout.

example:

layouts are as follows :

header
before.fileld
detail
after.field

one variable i.e. balance qty is calculated at detail1:before.layout and printed at after.field band.

I want to skip everything if this balance qty fileld is zero .

All bands are to be printed only balance qty is greater than 0

Help

This is a query report. If required I will write a session for the same.

Leenaa
28th January 2004, 09:25
hi srikant !
u can do one thing u can put up a condition bal.qty > 0(Balance qty shd b greater than zero ) in the Detail's output expression of report layouts

shrikantc
29th January 2004, 06:14
Leena,

It is not working may be because of bal qty is printed at
after.field band. and formula for the balance qty is delivered qty - Recieved qty in which recd. qty total is calculated at report script level.

Shrikant

Leenaa
29th January 2004, 06:28
can u plz post your script here,that would b much easier to understand that wht u did and and wht u want to do rest.

sharma
29th January 2004, 10:21
u can use like this

after.layout:
if bal.qty = 0 then
lattr.print = false
endif

Leenaa
29th January 2004, 11:45
This is a good idea but it would work only for after.layout though Srikant want to skip everything if the bal.qty = 0.

sharma
29th January 2004, 12:04
Try this way. it will work.

after.field...:
before.layout:
if bal.qty = 0 then
lattr.print = false
endif


__________________

shrikantc
30th January 2004, 06:58
Leena ,

As suggested by Sharma I had insrted the same but not working.




Please note that formula for printing balance qty in after layout is as below :

tdind042.quan-delq.m



Report Script

************************************************
|* tcsqldclist2 VRC B40l c4 vir
|* Delivery challans
|* bspc4
|* 29-12-03 [11:27]
|***********************************************
declaration:

domain tcqana delq.m |Delivered Quanity

after.tdind042.orno.1:
after.layout:
delq.m = 0
detail.1:
before.layout:
delq.m = delq.m + tdind043.rgqty



Query Text :

select
tdind041.suno, | Subcontractor
tdind042.orno, | Delivery order number
tdind041.pdno, | Production order
tdind041.trdt, | Date of Issue
tdind041.opno, | Operation

tdind041.suno, | Subcontractor
tdind042.orno, | Delivery order number
tdind041.pdno, | Production order
tdind041.trdt, | Date of Issue
tdind041.opno, | Operation
tdind042.pono, | Position No.
tdind042.item, | Item
tdind042.quan, | Input quantity
tdind043.rgqty, | Received good quantity
tdind043.reno, | Receipt No.
tdind043.rdat, | Receipt Date
tiitm001.dsca, | Description
tiitm001.copr | Standard Cost Price
from
tdind041, | Subcontracting Header
tdind042, | Subcontracting (Input lines)
tdind043, | Subcontracting (Output lines
)
tiitm001 | Items
where
tdind041.suno >= tdind041.suno.f and
tdind041.suno <= tdind041.suno.t and
tdind041.trdt >= tdind041.trdt.f and
tdind041.trdt <= tdind041.trdt.t and
tdind042.orno >= tdind042.orno.f and
tdind042.orno <= tdind042.orno.t and
tdind042.item = tiitm001.item and
tdind042.orno = tdind041.orno and
tdind043.orno = tdind042.orno
order by
tdind041.suno,
tdind042.orno


Shrikant

Leenaa
30th January 2004, 07:32
Dear Shrikant


You r displaying ur data in detail,so better to put this condion in detail also as well as in after.field so put up this conditions in both levels


detail.1:
before.layout:

if bal.qty = 0 then
lattr.print = false
endif

after.field.1:
before.layout:
if bal.qty = 0 then
lattr.print = false
endif

mbdagla
31st January 2004, 02:37
The exact code in the pattern suggested by Leena could be like this.


declaration:

domain tcqana delq.m |Delivered Quanity

after.tdind042.orno.1:
before.layout:
if delq.m = 0 then
lattr.print = false
endif
after.layout:
delq.m = 0
detail.1:
before.layout:
if tdind043.rgqty = 0 then
lattr.print = false
endif

delq.m = delq.m + tdind043.rgqty


However this code will not handle orders totalling to 0 with non-zero quantity properly.

chanbaan
31st January 2004, 05:27
hi Leena

before.layout:
if tdind043.rgqty = 0 then
lattr.print = false
endif

delq.m = delq.m + tdind043.rgqty

the conditions if tdind043.rgqty = 0 can be made comment
better use delq.m = delq.m statements alone,since the condition is if bal.qty > 0 then we have to suppress the layout.

i think this solve the problem

require Leena to close the problem

any queries greatly appreciated..

Regards
Chan

shrikantc
9th February 2004, 06:49
Currntly solved the problem by following way.

I had inserted one more condition in select statement i.e.

tdind043.rgqty i.e. good qty to be received - tdind042.quan i.e. received qty.

This will only print report for pending qty at subcontractor.\


Thanks

Shrikant