I.Benini
7th March 2005, 15:16
Hi all,
I have a problem in printing report via AFS. Session A launchs via AFS session B: session A prints a report and session B prints a report, too. The second report is printed correctly, but when the execution goes back to session A at the statement stpapi.end.session("B") then a fatal error occurs:
"Use of null pointer on ' '. Can not continue in B in DLL: ottstpapihand".
If I skip the report in session B everything is ok. I can't find out the solution: when the action goes back to session A all spool variables seems to be correct (spool.device is filled with the right value, spool.report is filled with the right report name), or at least they are all filled.
I looked for a solution here in Baanboard, but I didn't find any. Just a doubt: solution 217484 "Use of null pointer error during end session" (dated 2003-12-12 )in ttstpapihand could solve my problem? I can't acces to Kowledge Base of BaaN support (it seems out of order now), so if someone could explain the above mentioned solution it would be great.
Thanks in advance.

I.Benini
7th March 2005, 16:15
Sorry, 217484 isn't a solution number, but a "defect number". I check ottstpapihand and the last ident string is "DF213495, 2003/05/09, Small changes related to starting session", while I saw in a thread ("API requirements") also the string "DF217484, 2003/12/12 Use of null pointer error during end.session".
Thanks for help

I.Benini
7th March 2005, 16:41
Defect 217484 correspond to solution 140121 (see also solution 140547, linked solution 10923, 139890).
Other info:
BaanIV c4
SP 12 installed
Do you think that the "Use of null pointer error in end.session" can be definitevly resolved installing the above mentioned solutions or do you think that something is wrong with my scripts? In other words, is it possible to print a report in a session that calls via AFS another session that prints a report, too?

mark_h
7th March 2005, 17:30
What sessions? We can always check your code. The patch may help, but I can not promise that it will solve your problem. I do have it installed into one of our test environments. I also think this post (http://www.baanboard.com/baanboard/showthread.php?t=23355) may be related to yours. Currently I can not think of any code that I have written that calls a session that prints a report and also runs a sub-session that prints a report.

Mark

I.Benini
7th March 2005, 18:19
The sessions I defined as "A" and "B" aren't BaaN standard session. I attach (part of) session A and B scripts. Note that the spool.device is set to "D", and its spool variable are filled in choice.print.data (on.choice) in session "B" (spool.device = "D", spool.report = "tipcs912311000", and so on). When the action goes back to session "A" before executing stpapi.end.session("tipcs9123m000") the spool variables are set to the "original" values set for the tipcs9233m000 report (spool.device = "W-ULTRAEDIT", spool.report = "tipcs923311000", spool.fileout = "D:\....". The only different value is spool.time. Can it be?)
session A: tipcs9233m000
session B: tipcs9123m000.

I hope you could help me.
Thanks.
(Sorry for my English)

mark_h
7th March 2005, 21:13
I was hoping it was some standard sessions. Not sure I can help - I do recommend installing the patch and testing it. I noticed in the session A script that print.record ( usually used with open.report) is used instead of rprt_send() - the last time I looked at this (several years ago) this was what was casuing my null pointer error. I traced through the session I was playing It was also before this solution was available. Sorry but I do not think I can help.

Mark