tmannais
24th May 2018, 13:37
Hi,
I am struggling to print preview in a session using AFS. This is the current code.
|stpapi.handle.subproc(session.code, session.code, "add")
stpapi.set.report(session.code, "rtdsls140101000", "DOCMAN", error.msg)
if not isspace(error.msg) then
error.msg = "Cannot set report: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
|stpapi.put.field(session.code, "spool.preview", "1") | Set Print Preview
|stpapi.print.report(session.code, error.msg)
stpapi.form.command(session.code, 2, "tdsls1401m200", error.msg) | "tdsls1401m200" is the form command of the preview button inside print menu
if not isspace(error.msg) then
error.msg = "Cannot print preview: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
What I have tried:
- use stpapi.handle.subproc() with stpapi.print.report() and/or stpapi.form.command().
- use stpapi.print.report() alone, which displays a little session that allow me to select preview to print but after that it gives no report.
- use stpapi.put.field(session.code, "spool.preview", "1") with the printing functions above.
- print with/without stpapi.handle.subproc().
- changing printing device ranging from "D", "PDF", "SSRS", and "DOCMAN"(this is the device I aimed to use).
- stpapi.handle.subproc() to "tdsls1401m200" with action "add", and "send" because "tdsls1401m200" is the session of the preview print.
Nothing works. I really need your help. I just want to print out to device "DOCMAN" from only print preview by using AFS.
I am struggling to print preview in a session using AFS. This is the current code.
|stpapi.handle.subproc(session.code, session.code, "add")
stpapi.set.report(session.code, "rtdsls140101000", "DOCMAN", error.msg)
if not isspace(error.msg) then
error.msg = "Cannot set report: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
|stpapi.put.field(session.code, "spool.preview", "1") | Set Print Preview
|stpapi.print.report(session.code, error.msg)
stpapi.form.command(session.code, 2, "tdsls1401m200", error.msg) | "tdsls1401m200" is the form command of the preview button inside print menu
if not isspace(error.msg) then
error.msg = "Cannot print preview: " & error.msg
stpapi.end.session(session.code)
return(error.msg)
endif
stpapi.end.session(session.code)
return(error.msg)
What I have tried:
- use stpapi.handle.subproc() with stpapi.print.report() and/or stpapi.form.command().
- use stpapi.print.report() alone, which displays a little session that allow me to select preview to print but after that it gives no report.
- use stpapi.put.field(session.code, "spool.preview", "1") with the printing functions above.
- print with/without stpapi.handle.subproc().
- changing printing device ranging from "D", "PDF", "SSRS", and "DOCMAN"(this is the device I aimed to use).
- stpapi.handle.subproc() to "tdsls1401m200" with action "add", and "send" because "tdsls1401m200" is the session of the preview print.
Nothing works. I really need your help. I just want to print out to device "DOCMAN" from only print preview by using AFS.