Baanboard.com

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

User login

Frontpage Sponsor

Main

Google search


Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
36%
Installation Wizard into new VRC
36%
Manual into existing VRC
7%
Manual into new VRC
22%
Total votes: 45

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 24th May 2018, 12:37
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
[AFS] Print Preview

Hi,

I am struggling to print preview in a session using AFS. This is the current code.

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.

Last edited by tmannais : 24th May 2018 at 12:38. Reason: formatting code
Reply With Quote
Sponsored Links
  #2  
Old 24th May 2018, 22:22
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
I do not know this session, but I can do it in 4c4 to a windows printer like this:

Code:
	spool.device = "WINTESTPRINTER"
	spool.preview = true
|	spool.device ="D66"

|	spool.preview = false
 	stpapi.put.field("tuudi0420m000","user.f","")
 	stpapi.put.field("tuudi0420m000","user.t","ZZZZZZZZl")
 	stpapi.set.report("tuudi0420m000","rtuudi042011000",spool.device,err)
 	stpapi.continue.process("tuudi0420m000",err)
 	stpapi.end.session("tuudi0420m000")
}
__________________
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
  #3  
Old 25th May 2018, 04:00
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
Thanks mark_h. I tried what you suggested but It didn't work.
I also tried putting in all of the fields in the print session. It also didn't work.
Reply With Quote
  #4  
Old 25th May 2018, 13:12
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Does it even work if you send it to a printer or the display?
__________________
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
  #5  
Old 28th May 2018, 03:19
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
Yes. When I tested it by manually put the fields and click the buttons, it worked fine.
Reply With Quote
  #6  
Old 28th May 2018, 05:39
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
I tried changing session to print preview. It is now "tdsls1500m100".
This is current code:

Code:
spool.preview = 1
stpapi.put.field(session.code, "tdsls100.qono", str$(i.sales.quotation))
stpapi.find(session.code, error.msg)
if not isspace(error.msg) then 
        error.msg = "Cannot find record: " & error.msg
	stpapi.end.session(session.code)
	return(error.msg)
endif
stpapi.mark(session.code, error.msg)
if not isspace(error.msg) then 
        error.msg = "Cannot mark record: " & error.msg
	stpapi.end.session(session.code)
	return(error.msg)
endif
stpapi.set.report(session.code, "rtdsls140101000", "D", 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.print.report(session.code, error.msg)
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)
With this code, it displays a option window that contains "preview" option in it (See attached image). However, I have to click it manually and, moreover, nothing happens after that and the session is closed without errors.
What I need is just to print to that preview option with correct result.
Attached Images
File Type: png print-window.png (3.0 KB, 8 views)
Reply With Quote
  #7  
Old 29th May 2018, 00:18
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
That is an issue to start with - when you run AFS code nothing should pop up in the foreground. So not sure what is up with that. The screen that pops up almost looks like the screen that if you run manually it would pop up and ask you which report to run. So you find a sales quote, mark it, then I suppose you hit something like continue. When you run it manually does that same screen pop up? Also is it launching another session to do the printing?

The code I posted was setting the preview on ttstpspool device session. That is where I can select a windows printer and check print preview. This looks different that what I was thinking.
__________________
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
  #8  
Old 30th May 2018, 04:12
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
I find a Sales Quote, mark it, and then I try to print preview that's where the screen pops up. When I run it manually, after I click the preview menu in order to print preview it skips the screen and go straight to report selection and then followed by the device selection session.
Reply With Quote
  #9  
Old 30th May 2018, 13:49
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
You click the preview menu - is that a button or on the tools menu? Maybe this is something you have to run before you do the report command in the AFS code.
__________________
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
  #10  
Old 31st May 2018, 03:29
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
It is a tools menu called Action in LN Web UI. I attached an image so you can see what it looks like. However, this Action tools menu does not exist in BECS(Worktop). I mean it has its session and all but there is no menu or anything similar to this in LN Web UI. The closet thing it has is to print normally and choose preview option. I couldn't do that with AFS either.
In addition, I asked Infor Extreme Support about the DOCMAN device. He told me that this device specifically cannot be scripted to print as device DOCMAN because BECS(Worktop) cannot even handle the device. Device DOCMAN can only be used in LN Web UI on LN 10.3 or higher only.
So, in this case, I want to reduce the scope just to be able to print the preview with other normal device such as D, PDF, and SSRS. Don't bother with DOCMAN anymore. (but I really need that if it is somehow possible)
Attached Images
File Type: png print-preview.png (17.4 KB, 6 views)
Reply With Quote
  #11  
Old 31st May 2018, 15:19
mark_h's Avatar
mark_h mark_h is offline
Guru
 
Join Date: Sep 2001
Location: Kentucky, USA
Posts: 7,069
mark_h will become famous soon enough
Baan: Baan 4C4 A&D1 - DB: Oracle - OS: Sun Solaris
Wow - that is way out of my league. Anyway you do same type stuff with dal2 functionality?
__________________
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
  #12  
Old 1st June 2018, 03:28
tmannais's Avatar
tmannais tmannais is online now
Member
 
Join Date: Jul 2017
Posts: 53
tmannais is on a distinguished road
Baan: LN 10.5 - DB: MySQL - OS: Windows
I haven't tried achieving this with DAL2 because I thought it cannot be done like that but I will give it a try.
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
BwPrint: print preview and windows printer doesn't work Marcos Fernande Tools Administration & Installation 0 7th November 2013 13:21
3GL ASCII-Menu System for ERP-LN AndreasSchmitt Tools Development 7 5th June 2008 12:07
Print preview checkbox aguerra Tools Development 2 15th February 2008 12:16
Predefined variable for Print Preview vineetu1 Tools Development 1 28th November 2005 12:23
Print Preview nicklewe Tools Development 3 4th October 2002 20:32


All times are GMT +2. The time now is 11:41.


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