||1st August 2013 14:59
PDF problem while running session on AFS
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:
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
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)
spool.id = spool.open(REPORT.TO.BE.OPEN, "", 1)
tfgldf2215m00c.set.report(REPORT.TO.BE.OPEN, spool.device, error)
if isspace(error) then
if not isspace(error) then
|* AFS Error while Importing: $1%s
|* AFS Error while opening Report: $1%s
|* Process Completed
|* No data within selection
||1st August 2013 16:22
I don't think it is the AFS code at all. As far as I know when you run it as a scheduled job you do not have a client attached. Which means there is no excel and I assume no pdf creation tool that can be launched - since (and basing this off my system) devices like that tend to launch the executable for the tool. I do not know a good solution. What we did in one case was print the files to a unix directory. Then the users that want the reports can run a session to print them. In our case we just overwrite the files daily - then they can print to excel or a printer just the reports they want.
||1st August 2013 17:56
I run this session manually and give device as pdf. Report doesnt get generated.
||1st August 2013 17:57
AFS dll tfgldf2215m00c is created for session tfgld2215m000.
||2nd August 2013 19:52
Where do you define spool.device and spool.fileout? Because using lower case for excel did not work for me.
spool.device = "excel"
BUT make it upper case and it worked just fine:
spool.device = "EXCEL"
|All times are GMT +2. The time now is 21:29.
©2001-2018 - Baanboard.com - Baanforums.com