johnmark
9th May 2013, 15:47
Hi All,

We have one customized report Supplier Ledger in Infor LN FP7. In this report closing balance is forwarded as opening balance on next page. But on next page it takes first value from that same page. e.g.
Page 1-
Opening Balance = 0.00
Transaction Date Credit Debit Balance
01/01/2013 1500 1500.00
05/02/2013 200 1200.00

Page 2-
Opening Balance = 2000.00
Transaction Date Credit Debit Balance
06/02/2013 800 2000.00


In report script run.bal is taken as Opening balance. Here is report script:
declaration:
extern domain tfgld.amnt balance

domain tcmcs.str60 footer.line.1, footer.line.2
domain tcmcs.str13 session.code
domain tcnama login.name
extern domain tfgld.amnt run.bal

|******************************************************************************
before.program:
import("prog.name$",session.code)
tt.user(logname$, login.name)

footer.line.1 = "Printed by : " & trim$(login.name) & sprintf$(" on %D(%02d-%02m-%04Y)", date.num())
footer.line.2 = "Session Code: "& trim$(session.code)


before.bpid.1:
before.layout:

balance = open.bal
run.bal = open.bal
|***open.balance = open.bal


detail.1:
before.layout:

if isspace(ttyp) and docn = 0 then
lattr.print = FALSE
else

lattr.print = TRUE
endif


detail.2:
before.layout:
if isspace(ttyp) and docn = 0 then

lattr.print = FALSE

else
lattr.print = TRUE


endif



run.bal = run.bal + debit - credit

open.bal = run.bal
open.balance = run.bal


after.field.1:
before.layout:

run.bal = 0

-----------------------------------------------

mark_h
9th May 2013, 17:14
Does the layout "before.bpid.1" get printed on the top of each page? If so then this code gets executed every time a new page is create:

before.bpid.1:
before.layout:
balance = open.bal
run.bal = open.bal
|***open.balance = open.bal

You need to build in something to check if bpid has really changed or not to setup the new balance. You can look at using the if changed(somevar) then type functionality. This is my best guess.

johnmark
10th May 2013, 19:21
Thanks for your reply. I found solution for that script. But is there any way that we can check records on page 1 of report.

mark_h
10th May 2013, 22:53
Yes - you could do something like if lattr.pageno = 1 then.

johnmark
11th May 2013, 07:55
Hi,
Thanks for your quick reply. My issue is resolved.