saumya
1st August 2013, 14:59
Hi All,
I have written AFS on session tfgld2215m000 "Post Imported Journal Transactions".
Session which will call this AFS, can be run in job as well manually.
Here I am printing multiple records in single report.
If Running in JOB, I have hardcoded device, but when running manually device will be asked to enter. Report printing is working perfact if I am using notepad/ascif. if I give Pdf or excel no report is printing. Please Help.
Below is the code I am executing:
select tfgld213.idno
from tfgld213
where tfgld213._index1 inrange :idno.f and :idno.t
and tfgld213.ttyp inrange :ttyp.f and :ttyp.t
and tfgld213.imst = tfgld.imst.free
order by tfgld213.idno
selectdo
rcd.count = rcd.count + 1
curr.idno.f = tfgld213.idno
error = ""
if rcd.count = 1 then
if job.process then
spool.id = spool.open(REPORT.TO.BE.OPEN, DEVICE.TO.BE.USED, 0)
else
spool.id = spool.open(REPORT.TO.BE.OPEN, "", 1)
endif
endif
tfgldf2215m00c.put.Identification_Number.idno.f(curr.idno.f)
tfgldf2215m00c.put.Identification_Number.idno.t(curr.idno.f)
tfgldf2215m00c.put.Print_only_errors(hold.print.only.errors)
tfgldf2215m00c.put.Audit(hold.audit)
tfgldf2215m00c.put.Remove_Document_Lines(hold.remove.doc.lines)
tfgldf2215m00c.set.report(REPORT.TO.BE.OPEN, spool.device, error)
if isspace(error) then
tfgldf2215m00c.Import(error)
if not isspace(error) then
mess("tfgld2215.03c",1, error)
|* AFS Error while Importing: $1%s
break
endif
else
tfgldf2215m00c.end()
mess("tfgld2215.02c",1, error)
|* AFS Error while opening Report: $1%s
break
endif
tfgldf2215m00c.end()
selecteos
mess("tccom99988", 0)
|* Process Completed
selectempty
mess("tcccps0001", 0)
|* No data within selection
endselect
spool.close()
}
I have written AFS on session tfgld2215m000 "Post Imported Journal Transactions".
Session which will call this AFS, can be run in job as well manually.
Here I am printing multiple records in single report.
If Running in JOB, I have hardcoded device, but when running manually device will be asked to enter. Report printing is working perfact if I am using notepad/ascif. if I give Pdf or excel no report is printing. Please Help.
Below is the code I am executing:
select tfgld213.idno
from tfgld213
where tfgld213._index1 inrange :idno.f and :idno.t
and tfgld213.ttyp inrange :ttyp.f and :ttyp.t
and tfgld213.imst = tfgld.imst.free
order by tfgld213.idno
selectdo
rcd.count = rcd.count + 1
curr.idno.f = tfgld213.idno
error = ""
if rcd.count = 1 then
if job.process then
spool.id = spool.open(REPORT.TO.BE.OPEN, DEVICE.TO.BE.USED, 0)
else
spool.id = spool.open(REPORT.TO.BE.OPEN, "", 1)
endif
endif
tfgldf2215m00c.put.Identification_Number.idno.f(curr.idno.f)
tfgldf2215m00c.put.Identification_Number.idno.t(curr.idno.f)
tfgldf2215m00c.put.Print_only_errors(hold.print.only.errors)
tfgldf2215m00c.put.Audit(hold.audit)
tfgldf2215m00c.put.Remove_Document_Lines(hold.remove.doc.lines)
tfgldf2215m00c.set.report(REPORT.TO.BE.OPEN, spool.device, error)
if isspace(error) then
tfgldf2215m00c.Import(error)
if not isspace(error) then
mess("tfgld2215.03c",1, error)
|* AFS Error while Importing: $1%s
break
endif
else
tfgldf2215m00c.end()
mess("tfgld2215.02c",1, error)
|* AFS Error while opening Report: $1%s
break
endif
tfgldf2215m00c.end()
selecteos
mess("tccom99988", 0)
|* Process Completed
selectempty
mess("tcccps0001", 0)
|* No data within selection
endselect
spool.close()
}