Baanboard.com

Go Back   Baanboard.com > Forum > Baan SIGs > Code & Utilities

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 5th April 2006, 15:14
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Local File Selector

Hi all,

this is my solution for the general problem of selecting local files. Please follow the instrauction in the README file.

Notes:
Although located on the server, the BaanFileSelector.exe is of course run on the client and not on the server! It will be copied automatically to the Windows Temp directory if not already there and then started. To find out the location of the Temp directory on your PC you can type the following in your dos box:
cd %TEMP%

The program generates a text file in this temp directory which will then be copied back to the server for interrogation

You can do a stand alone test of the exe by copying it to your PC and running it. The usual windows file selector dialog should come up. If you select a file and exit a file BaanFileSelector.txt should be generated in the same directory.
Attached Files
File Type: zip BaanFileSelectror.zip (4.0 KB, 497 views)
__________________
May the force be with you!

Last edited by vahdani : 6th April 2006 at 10:31.
Reply With Quote
  #2  
Old 6th April 2006, 08:56
Andreas's Avatar
Andreas Andreas is offline
Senior Member
 
Join Date: Nov 2001
Location: Hannover
Posts: 263
Andreas is on a distinguished road
Baan: ERP LN FP5 - DB: Oracle 10g - OS: AIX, SLES
a bit more generic

Hi vahdani,
nice idea!
We do it the same way for some years now. Only difference is that the program is located on our server and we transfer and execute it to/on client from the Baan Session. No requirement to install on client and it also works with WebTop.

Next Step (if i will find the time) is to make the FileSelector Program platform independent (java ?) so it can also be used from a Linux-Client.

Andreas
__________________
Jazz is not dead, it just smells funny!
F.Z.
Reply With Quote
  #3  
Old 6th April 2006, 10:25
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Hi Andreas,

I think I caused some misunderstanding in my description: My solution works exactly like yours. The BaanFeleSelector.exe is on the sever and will be copied to the client if not already there.

As for platform independence: This is not going to be easy as long as there is nothing comparable to bwdll for Linux.
__________________
May the force be with you!
Reply With Quote
  #4  
Old 3rd August 2006, 14:50
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Hi Vahdani,

I have a suggestion for a serious practical improvement. Right now I cannot determine the file types to be looked for. It would be very handy if I can for instance send an optional variable along in the Baan function, with the file type(s) which the file browser dialog should display, and maybe another parameter indicating whether the user is allowed to choose different file types in the dialog, just like regular Windows functionality...

For instance, for a data import program I want users to be able to see only txt-files..

Would be great if you added this feature to your program..


Regards,
En
Reply With Quote
  #5  
Old 7th August 2006, 18:13
vahdani's Avatar
vahdani vahdani is offline
Guru
 
Join Date: Aug 2002
Location: Cologne, Germany
Posts: 418
vahdani is on a distinguished road
Baan: all - DB: all - OS: Unix / Win2K
Done!

Hi En!

Thank you for your very good suggestion. Here a new version with filter functionality that you requested. Please note that the old exe must be removed from client Temp folder (see README.txt file enclosed).

There is now an extra paramter for filter string in the form of:
description1|filter1|description2|filter2|...

example: "All files| *.*|pdf files |*.pdf"
Attached Files
File Type: zip BaanFileSelectror_v2.zip (4.7 KB, 430 views)
__________________
May the force be with you!
Reply With Quote
Sponsored Links
  #6  
Old 9th August 2006, 09:40
en@frrom en@frrom is offline
Guru
 
Join Date: Aug 2003
Location: Belgium
Posts: 1,219
en@frrom will become famous soon enough
Baan: B50B - DB: Oracle 8.0 - OS: Win2k AS
Thanks for this updated version. It works fine. Just had to do 2 little changes to the script to get it working: you probably forgot to include
#pragma used dll ottdllbw

and I gave the path in function server2client instead of the non-declared variable you used..

Thanks a lot!
Reply With Quote
  #7  
Old 28th November 2006, 11:13
george7a's Avatar
george7a george7a is offline
Guru
 
Join Date: May 2004
Location: Nazareth
Posts: 1,490
george7a is on a distinguished road
Baan: IVc, 5.0 b, 5.0 c, LN 6.1 - DB: MS SQL, Oracle - OS: Windows 2000, 2003 & UNIX
Thumbs up In LN...

In LN the following functions are available (from ottdllbw)

Code:
function extern long seq.open.dialog.local(
	 boolean mselect,
	 const string defaultname(),
	 const string directory(),
	 const string filter(),
	 ref string filename() )

Descr	: Show the Windows file-open dialog to allow the user to select one or more files.
Pre	: 
Post	: When multiple select was specified and more than one files selected by the user
	  some state information is saved for subsequent calls to seq.open.dialog.next()
	  This state information is set in xmlFileNameNodes and xmlCurFileNameNode.
Input	: mselect 	when true multiple select is allowed by the user.
	  defaultname 	The default filename shown in the file-open dialog
	  directory	The startup directory for this dialog. In case of an empty string
	  		the My Documents directory will be the default.
	  filter	Specifies all possible file extensions for the file. The string must 
	  		contain pairs of strings that are separated by a "|" character.
	  		The first string in each pair is a filter name. The second string must
	  		be a filter pattern. Multiple filters patterns can be specified by separating
	  		them with a semicolon.
Output	: filename	Will contain the full pathname of the file selected by the user. In case
			mselect is true, possible other selected filenames can be retrieved using 
			function seq.open.dialog.next().
Return	: > 0 Number of files selected by the user.
	  0   No files selected (cancel pressed by the user)
	  -1  Error occurred.

|******************************************************************************|

function extern boolean seq.open.dialog.next(
	 ref string filename() )

Descr	: Retrieve the next full pathname of the file selected by the user in a previous
	  seq.open.dialog.local() function. This function should only be used when a previous
	  call to seq.open.dialog.local() returned a value greater than 1.
Pre	: State information is set in xmlFileNameNodes and xmlCurFileNameNode.
Post	: xmlCurFileNameNode updated. When the last node was retrieved, the xmltree referred
	  to by xmlFileNameNodes is deleted and these variables are set to 0.
Input	: -
Output	: filename	Will contain the full pathname of a file selected by the user.
Return	: true when succesfully retrieved the next file name.
	  false when failed to retrieve the next file name.

function extern long seq.open.local(
	 const string filename(),
	 string mode(2),
	 [ long remove.after.use ],
	 [ long read.only ] )

Descr	: this function opens the file, specified by the file argument, on the client.
	  A pointer is returned to be used to identity the filepointer(fp) in the 
	  subsequent operations
Pre	: -
Post	: file is opend on the client system.
Input	: see param list
	  <optional> remove.after.use remove local file when file is closed
	  <optional> read.only when value <> 0 the file attribute 'read-only' will be set
		     This is used by script editors like CodeWright to display a file in 
		     read-only mode	
Output	: -
Return	: >0	success; file pointer returned for use in the local subsequent operations.
	  <=0	error; that is, the file could not be opened.

|**********************************************************************|

function extern long seq.saveas.dialog.local(
	 const string defaultname(),
	 const string directory(),
	 const string filter(),
	 ref string filename() )

Descr	: Show the Windows file-save-as dialog to allow the user to select one new or
	  existing file to save.
Pre	: -
Post	: -
Input	: defaultname 	The default filename shown in the file-save-as dialog
	  directory	The startup directory for this dialog. In case of an empty string
	  		the My Documents directory will be the default.
	  filter	Specifies all possible file extensions for the file. The string must 
	  		contain pairs of strings that are separated by a "|" character.
	  		The first string in each pair is a filter name. The second string must
	  		be a filter pattern. Multiple filters patterns can be specified by separating
	  		them with a semicolon.
Output	: filename	Will contain the full pathname of the file selected by the user.
Return	: 1   One file selected by the user.
	  0   No files selected (cancel pressed by the user)
	  -1  Error occurred.

|*********************************************************************|

function extern long dir.select.dialog.local(
	 ref string dirname() )

Descr	: Show the Windows Folder browser dialog to allow the user to select one new or
	  existing folder (directory)
Pre	: -
Post	: -
Input	: -
Output	: dirname	Will contain the full pathname of the directory selected by the user.
Return	: 1   One directory selected by the user.
	  0   No directory selected (cancel pressed by the user)
	  -1  Error occurred.
- George
__________________
_
George Abdo
NAZDAQ - Your Documents, Your Way.
Reply With Quote
  #8  
Old 26th March 2007, 11:04
kysersoze12 kysersoze12 is offline
Junior Member
 
Join Date: Dec 2006
Posts: 26
kysersoze12 is on a distinguished road
Baan: BAAN IV - DB: Informix - OS: UNIX
Thumbs up

Excellent utility .
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 Off
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Programming Question mr_suleyman Tools Development 37 11th November 2016 08:14
stpapi.synchronize.dialog() not working in whltc1500m000 RobertB AFS/DDC/OLE: Function servers 7 14th April 2005 07:52
CODE: Local PC File Dialog Box (UNIX & W98) alejandro Code & Utilities 3 13th January 2005 20:42


All times are GMT +2. The time now is 09:58.


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