jp.aalders
4th November 2014, 14:14
Ey Guru's

In a session I use AFS to activate a print session. This works all fine and I am able to pass printer the user requested via AFS using the command
stpapi.set.report(session, report, print.device, errormess)

Do anyone know if it is possible the set the pages from - to in the ttstpsplopen session when using AFS.

Thanks in advance!

mark_h
4th November 2014, 15:47
I think it is possible. I am not sure I do that anywhere - but I do know I set the number of copies in one place. The way I have to do spool.pr.copies involves having to export it and import it into the printing session. I think you need to figure out what the variables might be for the start and end page. I glanced but did not see a spool.something for it. I will look some more as I get a chance.

mark_h
4th November 2014, 15:52
Found them using bic_info on ottstpsplopen. Try spool.pr.from and spool.pr.to. Like I said you might have to export and import the variables into the program doing the printing.

jp.aalders
4th November 2014, 16:33
Hi Mark, thanks for sorting out at such short notice! Grateful for that. :)

Based on your info I might be possible by doing something like this:

|* Import the spool variables
import("sp_from", spool.pr.from")
import("sp_to", spool.pr.to")

|* Set the new values
sp_from = 1 |* From Page 1
sp_to = 10 |* To Page 10

|* Export the values
export("sp_from", spool.pr.from")
export("sp_to", spool.pr.to")

|* Execute the AFS
stpapi.set.report(session, report, print.device, errormess)

:confused:

bhushanchanda
4th November 2014, 16:38
Hi,

I guess what he means is, you need to do that in the report script. Pass the values from your session and in the report script, import them.

jp.aalders
4th November 2014, 17:31
Are you sure about that.... when the reportscript is executed the spool meganism is already active. In my perception these values should be set before the reportscipt is executed... :confused:

bhushanchanda
4th November 2014, 17:39
Possible. But as we are forcing those variables to have these two values, it might be checking if the current page is within From Page and To Page before printing.

You can give both the ways a shot.

mark_h
5th November 2014, 16:17
All I do is import them into the session script that generates the report. So for example my AFS session tdexi3205m000 has this in it:


export("spool.pr.copies", spool.pr.copies)
export("spool.fileout",spool.fileout)
print.config.report() | Routine to print tiedm9410m000 report


Then tiedm9410m000 has this in it:

before.program:
initialize.company.language()
| itisfc0000.read.parameters() |#4.0.o
tisfc.dll0000.read.parameters() |#4.0.n
if api.mode then
import("spool.pr.copies",spool.pr.copies)
import("spool.fileout",spool.fileout)
endif

bhushanchanda
5th November 2014, 16:25
Aha, so I guess he will need a wrapper as well. :)

mark_h
5th November 2014, 18:47
Aha, so I guess he will need a wrapper as well. :)

Good point. Source code or a wrapper.

jp.aalders
17th November 2014, 23:10
little delay, apologize for that :o

Based on the posts above I understand that I would need the source for the standard Baan session. In this specific case we print our purchase orders (tdpur4401m000) using an AFS session. When I am correct the import/export should be done in the tdpur4401 and not in the AFS session the executes the tdpur4401m000. This would mean I am finished without source :-(

Correct?

Thanks again for the input guys!

bhushanchanda
18th November 2014, 10:37
Hi,

Not finished. You can use ~Vamsi's Solution (http://www.baanboard.com/baanboard/showthread.php?p=189415#post189415) and create a wrapper for the standard session where you can import the values.