lli-baan
1st June 2006, 11:16
Hi Folks,
I have a small but very tricky problem (at least tricky for me).
For archiving some Reports we need the possibility the "reprint" an Report on the night. Therefore we created a table with the needed data including the value of the brp_auto_spool_id. To archive the report we would use the "reprint" Button of the Session ttaad3120m000.
Is it possible to start and handle this session with the API-Functionality? For me it is not possible to create the API Function Server with the ttstpcreatdll --> you have no authorization to change the standard !
Can anybody give me a hand?
Han Brinkman
1st June 2006, 13:17
You can't create libraries or something else in the tools packages. However if you look into libraries created for AFS you'll see that these are just wrappers around afs functions. You can use the afs functions directly to write a program around the tools session that you want to handle.
Regards,
Han
lli-baan
1st June 2006, 14:34
Dear Han,
thank you for your help!
The first problem is, that I never programmed the AFS myself (but I think I could handle this)! The second problem is the real problem: how can I handle the "Repeat Request"-Button? :confused:
mark_h
1st June 2006, 23:17
My first guess would be that it is stpapi.continue, but it could be something else like one of the choice user options. Try that first.
george7a
2nd June 2006, 09:37
The first problem is, that I never programmed the AFS myself (but I think I could handle this)! The second problem is the real problem: how can I handle the "Repeat Request"-Button? :confused:
Hi,
This link should help:
http://baanboard.com/baanboard/showthread.php?t=7251
- George
mark_h
2nd June 2006, 17:26
After looking at the session it looks like this would use stpapi.application.option(string session, long form,
long option, ref string err.mesg) where the option is 0.
en@frrom
6th June 2006, 12:25
Mark is right, it is user option 0. Hope you won't bump in to AFS/Tools conflicts, which is the case for various other Tools-sessions called by AFS...
Let us know please if it works..
jcarlosy
19th September 2007, 12:58
I have the same requirement (printing reports from device queue) and I'm using user option 0, but i'm getting the following error message (Device not found). How can I solve this ?
mark_h
19th September 2007, 14:35
Post your code so we can see what it is doing.
jcarlosy
21st September 2007, 09:45
First, thank you for reply.
This is the script:
stpapi.put.field("ttaad3120m000","ttaad320.user","10810")
stpapi.put.field("ttaad3120m000","ttaad320.seqn","119064")
ret = stpapi.find("ttaad3120m000",err.msg)
if ret = 1 then
stpapi.set.report ("ttaad3120m000","rtcmcs041001000","D",err.msg)
stpapi.application.option("ttaad3120m000", 1, 0, err.msg)
if not isspace(err.msg) then
message(err.msg)
endif
endif
stpapi.end.session("ttaad3120m000")
User 10810 and seqn 119064 is the record in table ttaad320, and report rtcmcs041001000 is the report name of this record.
And the message is "Device not found"
mark_h
21st September 2007, 14:23
I have a feeling it is the report, but let me go try it on our test system.
mark_h
21st September 2007, 14:35
Okay - this reprints it to the display.
function reprint()
{
stpapi.put.field("ttaad3120m000","ttaad320.user","701holla")
stpapi.put.field("ttaad3120m000","ttaad320.seqn","4066")
rc = stpapi.find("ttaad3120m000",err)
if rc = 1 then
stpapi.application.option("ttaad3120m000", 1, 0, err)
if not isspace(err) then
message(err)
endif
endif
stpapi.end.session("ttaad3120m000")
}
Let me see if I can figure out the other options.
mark_h
21st September 2007, 14:46
And this prints to a printer that I change:
stpapi.put.field("ttaad3120m000","ttaad320.user","701holla")
stpapi.put.field("ttaad3120m000","ttaad320.seqn","4066")
rc = stpapi.find("ttaad3120m000",err)
if rc = 1 then
spool.device ="LOUIR01"
stpapi.set.report ("ttaad3120m000","rttadv443001000",spool.device,err)
stpapi.application.option("ttaad3120m000", 1, 0, err)
if not isspace(err) then
message(err)
endif
endif
stpapi.end.session("ttaad3120m000")
}
I sent the original report to a screen, so at first I thought I was doing the disp request option. So this works on my system.
günther
24th September 2007, 12:12
To be a bit more general, I think it would be better to use
stpapi.set.report("ttaad3120m000",
"r" & ttaad320.rpac & ttaad320.rmod & ttaad320.repc,
spool.device, err)