Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Development

User login

Frontpage Sponsor

Main

Poll
For ERP LN feature pack upgrade, what method of install are you using?
Installation Wizard into existing VRC
35%
Installation Wizard into new VRC
42%
Manual into existing VRC
3%
Manual into new VRC
19%
Total votes: 31

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 7th December 2016, 13:16
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 48
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
run.prog not working

Hello ,

here is my code to convert .XLS file to .XLSX file

Code:
o.command.line = "/S" & quoted.string("D:\test.XLS")
			&" /T" & quoted.string("D:\test_new.XLSX")
			& " /F51 /C-4143 /M2"


ret = run.prog(	"D:\ConvertXLS.EXE", " " & strip$(o.command.line),
				RP_WAIT, "", file.out, file.err)

but execution stops after run.prog command .
This command is perfectly working in command prompt

Last edited by bhushanchanda : 7th December 2016 at 13:20. Reason: added code tags
Reply With Quote
  #2  
Old 7th December 2016, 13:22
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Moved to Tools Development Forum.

Have you tried using RP_NOWAIT? Does the executable have execute permissions set to everyone? Also, does the output file folder have full permissions?

Also, I can see there is no space after "/S" and "/T" which I believe should be there.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #3  
Old 8th December 2016, 05:42
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 48
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
hello,

i have tried all combination , with space ,without space and also with RP_NOWAIT.
but it is not working.
this command is run propertly in command prompt , but with using run.prog it's giving -1 as return value.
Reply With Quote
Sponsored Links
  #4  
Old 8th December 2016, 08:58
oirfeodent's Avatar
oirfeodent oirfeodent is offline
Member
 
Join Date: Jun 2016
Posts: 48
oirfeodent is on a distinguished road
Baan: Baan - DB: DB - OS: OS
Quote:
Originally Posted by frenny View Post
hello,

i have tried all combination , with space ,without space and also with RP_NOWAIT.
but it is not working.
this command is run propertly in command prompt , but with using run.prog it's giving -1 as return value.
Error Code <0 indicates program could not be started.
Code -1 could indicate EPERM or Permission Error.

However, is there any entry in the file.out or file.err?

Regards,
Reply With Quote
  #5  
Old 8th December 2016, 13:48
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,286
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Yes. Looks like a permission issue to me as well. You can try adding the executable to a new folder in the D: directory and then try calling it. Also, if that's not working, use
Code:
cmd full_path_of_program_name parameters
and check if that works e.g. this
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #6  
Old 8th December 2016, 13:50
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 48
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Hello,

i have full access to all the drives, even i have tried the same code with server path but it is not working.
this code is working fine with "start.application.local" but we have to implement this functionality in HTML UI and start.application.local is not working in HTML UI.
and also no such error is coming in error file.
Reply With Quote
  #7  
Old 9th December 2016, 12:19
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 48
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Hello ,

i have tried same code on server path,but it will goes in infinite loop.
i have also tried with "cmd " but same result .
Reply With Quote
  #8  
Old 12th December 2016, 19:23
NPRao's Avatar
NPRao NPRao is offline
Guru
 
Join Date: Aug 2001
Location: Pacific NW, USA
Posts: 3,028
NPRao will become famous soon enough
Baan: iBaanERP-5.2a(Reger),SSA-ERP-LN-6.1,Infor LN-10.x - DB: Oracle-10g,11g,12c,MS-SQL - OS: HP-UX, Linux, Windows
Quote:
this code is working fine with "start.application.local" but we have to implement this functionality in HTML UI and start.application.local is not working in HTML UI.
Refer to the latest Programmer's guide -
Quote:
start.application.local()
Syntax:
#include <bic_desktop>

function boolean start.application.local (string commandline, boolean waitFlag, ref long exitCode [, const string verb])

Description

This starts the client application specified in the commandline argument.

Arguments
string commandline This specifies the command that starts the application. If commandline does not include a directory path, Windows searches for the executable file in the following directories, in the order shown below:

The Windows system directory.
The Windows directory.
The directories listed in the PATH environment variable.
This argument may also contain the full pathname of a local document. In this case the application associated with this document extension will be started.

The commandline parameter may one or more times include the string ${BSE_TMP} which indicates the ${BSE}\tmp directory in case of Baan Windows or Windows temp directory in case of WebUI.

boolean waitFlag Indicates whether the application must wait for the local application to exit.

ref long exitCode Exit code of local application. Only contains a valid exit code when the waitFlag attribute was true

[const string verb] When the commandline argument contains a document pathname, the optional verb argument may contain the action to be performed on this document. The default action is "open". Another useful verb is: "print". In case this argument is supplied, the waitFlag argument will be ignored and the execution will always by asynchronous.

Return values
true Application started successfully.
false Application failed to start.

Context
This function is implemented in the 4GL Engine and can be used in all script types.

Notes
This function is not supported in HTMLUI. See the Implementing HTML UI support for more information.
Implementing HTML UI support
Quote:
Introduction
As HTMLUI does not support functionality that requires a higher privilege level on the client, some client access functions are not allowed anymore. Calls to these functions have to be replaced with other client access functions which are allowed to be used when running in HTMLUI mode. Also, when a session has fields on its form for specifying a client file or client folder, these fields have to be hidden when running in HTMLUI mode.

unsupported client functions in HTMLUI mode
The following functions are not supported when the client runs in HTMLUI mode:

client2server()
server2client()
create.local.file()
create.local.directory()
dir.select.dialog.local()
get.client.directory()
get.client.hostname()
get.local.filename()
remove.local.directory()
remove.local.file()
seq.fstat.local()
seq.open.dialog.local()
seq.open.dialog.next()
seq.saveas.dialog.local()
start.application.local()
When one of these functions is used while running in HTMLUI mode, the following message appear:

This function is not supported in the HTMLUI WebUI: <function>

HTMLUI client functions
The following functions have to be used when the client runs in HTMLUI mode:

Single file functions:

client.upload.file
client.download.file
client.show.file
Multiple file functions:

client.prepare.download
client.add.download.file
client.start.download
client.upload.files
client.get.upload.filecount
client.get.upload.file
client.delete.upload.file.object
Assisting functions:

get.ui.mode()
tc.is.html.ui()
tc.is.thin.client()
client.get.media.type
When one of the HTMLUI client functions is used while NOT running in HTMLUI mode, the following message appear:

This function is not supported in the WebUI: <function>
__________________
The art of perfection does not lie in doing extraordinary things but, doing ordinary things extraordinarily well. [-N. Prashanth Rao]
How To Ask Questions The Smart Way,BaaNBoard,NPRao
Reply With Quote
  #9  
Old 22nd December 2016, 12:28
oirfeodent's Avatar
oirfeodent oirfeodent is offline
Member
 
Join Date: Jun 2016
Posts: 48
oirfeodent is on a distinguished road
Baan: Baan - DB: DB - OS: OS
Quote:
Originally Posted by frenny View Post
Hello,

i have full access to all the drives, even i have tried the same code with server path but it is not working.
this code is working fine with "start.application.local" but we have to implement this functionality in HTML UI and start.application.local is not working in HTML UI.
and also no such error is coming in error file.
From HTMLUI, running an "exe" is going to be next to impossible.
The browser framework (used by HTMLUI) does not allow to run an exe(cutable file).

If your baan server is running on a Windows Server, then you can install this "ConvertXLS.EXE" on the server side... Execute the conversion on the server side and directly download the converted file using "client.download.file"... remember to use "get.ui.mode" and build the logic based on that.

Regards,
Reply With Quote
  #10  
Old 23rd December 2016, 07:50
frenny's Avatar
frenny frenny is offline
Member
 
Join Date: Oct 2013
Posts: 48
frenny is on a distinguished road
Baan: ERP LN - DB: sqlserver 2012 - OS: winxp
Microsoft not supproted

hi all,

Here microsoft words for using runtime creation of new excel exe.

"Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any non-interactive client application".

so currently i have tried other way to fulfil my requirement.

Thank you all for reply
Frenny
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
function keys on oracle linux not working with ba6.2 interface Harrie65 Blogs and Web links 1 10th October 2016 08:32
Working Day abby13 Tools Development 2 26th February 2009 06:16
run.prog will not work!! Jabran Tools Development 9 8th September 2006 10:34
running server side programs using run.prog() trchandra Tools Development 3 21st March 2003 05:50


All times are GMT +2. The time now is 18:27.


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