Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > AFS/DDC/OLE: Function servers

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
37%
Installation Wizard into new VRC
39%
Manual into existing VRC
3%
Manual into new VRC
21%
Total votes: 38

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 1st August 2013, 14:59
saumya's Avatar
saumya saumya is offline
Member
 
Join Date: Feb 2008
Posts: 81
saumya is on a distinguished road
Baan: Infor LN, ION - DB: Oracle - OS: unix
PDF problem while running session on AFS

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:
Code:
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()
}
__________________
The world is a tragedy to those who feel,
but a comedy to those who think.

Last edited by mark_h : 1st August 2013 at 16:09. Reason: Add code tags.
Reply With Quote
  #2  
Old 1st August 2013, 16:22
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,933
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
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.
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Sponsored Links
  #3  
Old 1st August 2013, 17:56
saumya's Avatar
saumya saumya is offline
Member
 
Join Date: Feb 2008
Posts: 81
saumya is on a distinguished road
Baan: Infor LN, ION - DB: Oracle - OS: unix
Hi Mark,

I run this session manually and give device as pdf. Report doesnt get generated.

Thanks.
__________________
The world is a tragedy to those who feel,
but a comedy to those who think.
Reply With Quote
  #4  
Old 1st August 2013, 17:57
saumya's Avatar
saumya saumya is offline
Member
 
Join Date: Feb 2008
Posts: 81
saumya is on a distinguished road
Baan: Infor LN, ION - DB: Oracle - OS: unix
AFS dll tfgldf2215m00c is created for session tfgld2215m000.
__________________
The world is a tragedy to those who feel,
but a comedy to those who think.
Reply With Quote
  #5  
Old 2nd August 2013, 19:52
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 6,933
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Where do you define spool.device and spool.fileout? Because using lower case for excel did not work for me.
Code:
               spool.device = "excel"
                spool.fileout ="testd"
BUT make it upper case and it worked just fine:
Code:
               spool.device = "EXCEL"
                spool.fileout ="testd"
                stpapi.put.field("tcmcs0403m000","cwar.f","   ")
                stpapi.put.field("tcmcs0403m000","cwar.t","ZZZ")
               stpapi.set.report("tcmcs0403m000","rtcmcs040301000",spool.device,err)
               stpapi.continue.process("tcmcs0403m000",err)
               stpapi.end.session("tcmcs0403m000")
__________________
Mark

GO Cards!
My latest mantra - make sure you have latest stpapi patches and the latest session object. If on LN then please explore the option of using DAL2 functionality.

Shared Solutions for Baan systems provided free by Baan Board.
Play the Google game and help Baanboard get better rankings. Do your part. Click here to find how.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in afs related to session cprpd1100m000 VishalMistry AFS/DDC/OLE: Function servers 2 19th April 2010 17:30
User Management - Session Authorization Problem baan_player Tools Administration & Installation 3 28th November 2009 21:59
AFS problem: I cannot kill both sessions (child and parent) simona AFS/DDC/OLE: Function servers 3 30th September 2009 17:27
Label problem for the satellite session of MMT rahul.kolhe22 Tools Development 5 31st August 2009 17:28


All times are GMT +2. The time now is 00:48.


©2001-2017 - Baanboard.com - Baanforums.com