Opening file on IFS
-
- Profound User
- Posts: 40
- Joined: Mon Apr 26, 2010 11:53 am
- First Name: RICHARD
- Last Name: RUTA
- Company Name: WILLAM B. MEYER
- Phone: 203.984.7175
- Address 1: 255 LONG BEACH BLVD
- City: STRATFORD
- State / Province: Connecticut
- Zip / Postal Code: 06615
- Country: United States
- Contact:
Opening file on IFS
I'd like to open an EXCEL file on the IFS. I can do this on the C: drive:
var file = get("ExportFile"); var path = "\\program files\\microsoft office\\office12\\excel.exe c:\\temp\\" + file; alert(path); runPCCommand(path);
But I can't open the file using the command, i.e. path, below as, I think, you recommended:
var file = get("ExportFile"); var path = "\\program files\\microsoft office\\office12\\excel.exe /tiffs/" + file; alert(path); runPCCommand(path);
EXCEL opens but the file itself is not loaded.
Thanks, as always, for your help.
var file = get("ExportFile"); var path = "\\program files\\microsoft office\\office12\\excel.exe c:\\temp\\" + file; alert(path); runPCCommand(path);
But I can't open the file using the command, i.e. path, below as, I think, you recommended:
var file = get("ExportFile"); var path = "\\program files\\microsoft office\\office12\\excel.exe /tiffs/" + file; alert(path); runPCCommand(path);
EXCEL opens but the file itself is not loaded.
Thanks, as always, for your help.
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
Re: Opening file on IFS
I see that you have an alert in there that shows the file path. What does this path look like?
-
- Profound User
- Posts: 40
- Joined: Mon Apr 26, 2010 11:53 am
- First Name: RICHARD
- Last Name: RUTA
- Company Name: WILLAM B. MEYER
- Phone: 203.984.7175
- Address 1: 255 LONG BEACH BLVD
- City: STRATFORD
- State / Province: Connecticut
- Zip / Postal Code: 06615
- Country: United States
- Contact:
Re: Opening file on IFS
Please see attached for the path that is not working.
The path that worked resolved to:
. . . \excel.exe c:\temp\boltst.csv
The path that worked resolved to:
. . . \excel.exe c:\temp\boltst.csv
- Attachments
-
- Path.docx
- (19.69 KiB) Downloaded 603 times
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
Re: Opening file on IFS
I see.
What you'll need to do is open the document a different way. In your example, you are calling the Excel executable using the PC command Applet. When done that way, Excel is only going to understand a local PC or mapped network drive path. It will not understand a path on the http server. If you wanted to open Excel in this way (not recommended) you'd need to map a drive to the IFS on each end user PC and use the network drive name.
To open your document without having to worry with any of that, try using this JavaScript code instead:
This function will simply link your browser to the document on the http server. It also disables the"Are you sure you want to leave this page" message while it's at it.
Your browser will open the document in Excel because it associates Excel with the ".csv" extension.
The file path from your example will work, assuming the file is actually located at:
The folder /www/profoundui/htdocs is the http server's "document root" folder, and is never given in a path. The paths are always given as if this folder is the root of the entire file system.
What you'll need to do is open the document a different way. In your example, you are calling the Excel executable using the PC command Applet. When done that way, Excel is only going to understand a local PC or mapped network drive path. It will not understand a path on the http server. If you wanted to open Excel in this way (not recommended) you'd need to map a drive to the IFS on each end user PC and use the network drive name.
To open your document without having to worry with any of that, try using this JavaScript code instead:
Code: Select all
pui.link(file);
Your browser will open the document in Excel because it associates Excel with the ".csv" extension.
The file path from your example will work, assuming the file is actually located at:
Code: Select all
/www/profoundui/htdocs/tiffs/boltst.csv
-
- Profound User
- Posts: 40
- Joined: Mon Apr 26, 2010 11:53 am
- First Name: RICHARD
- Last Name: RUTA
- Company Name: WILLAM B. MEYER
- Phone: 203.984.7175
- Address 1: 255 LONG BEACH BLVD
- City: STRATFORD
- State / Province: Connecticut
- Zip / Postal Code: 06615
- Country: United States
- Contact:
Re: Opening file on IFS
Sorry, Still not getting this.
Using this command:
pui.link ("/tiffs/boltst.csv");
The file opens, but not in EXCEL. And the back arrow take you to EOJ.
I think that's why I tried the PC command initially.
Using this command:
pui.link ("/tiffs/boltst.csv");
The file opens, but not in EXCEL. And the back arrow take you to EOJ.
I think that's why I tried the PC command initially.
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
Re: Opening file on IFS
I've tested this in a simple test screen and it seems to work fine -- the CSV file is opened in Excel.
Maybe the trouble is that your PC does not associate Excel with the file extension ".csv"? If you have a CSV file on your desktop, for example, does it show with an Excel icon?
Maybe the trouble is that your PC does not associate Excel with the file extension ".csv"? If you have a CSV file on your desktop, for example, does it show with an Excel icon?
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
Re: Opening file on IFS
I think I see what you mean now. The technique of linking the browser to a CSV file only works in Internet Explorer. Other browsers try to show the file on their own and navigate you away from the PUI screen.
You must be using a different browser, right?
In this case, maybe calling the Excel exectuable directly is the way to go. Excel (at least 2007 or higher, I don't know if this works with earlier versions) can fetch the file from a web URL.
For example, you can set your "file" variable to something like this:
Excel will then fetch the file through the http server and you will not have to worry with mapped drives or anything like that.
Does this help?
You must be using a different browser, right?
In this case, maybe calling the Excel exectuable directly is the way to go. Excel (at least 2007 or higher, I don't know if this works with earlier versions) can fetch the file from a web URL.
For example, you can set your "file" variable to something like this:
Code: Select all
http://yourServer:yourPort/tiffs/boltst.csv
Does this help?
-
- Profound User
- Posts: 40
- Joined: Mon Apr 26, 2010 11:53 am
- First Name: RICHARD
- Last Name: RUTA
- Company Name: WILLAM B. MEYER
- Phone: 203.984.7175
- Address 1: 255 LONG BEACH BLVD
- City: STRATFORD
- State / Province: Connecticut
- Zip / Postal Code: 06615
- Country: United States
- Contact:
Re: Opening file on IFS
I switched to Explorer from Google Chrome and tried to run the command. I got the message asking if I wanted to navigate away from the page. Even saying 'yes' did not get me anywhere. By the way, Explorer is not an option.
-
- Profound User
- Posts: 40
- Joined: Mon Apr 26, 2010 11:53 am
- First Name: RICHARD
- Last Name: RUTA
- Company Name: WILLAM B. MEYER
- Phone: 203.984.7175
- Address 1: 255 LONG BEACH BLVD
- City: STRATFORD
- State / Province: Connecticut
- Zip / Postal Code: 06615
- Country: United States
- Contact:
Re: Opening file on IFS
I tried the IP address and port as I understand them and got nowhere. Would you give me an example of what the syntax of "//yourServer:yourPort/" should look like?
- David
- Profound Logic Staff Member
- Posts: 690
- Joined: Fri Jan 04, 2008 12:11 pm
- First Name: David
- Last Name: Russo
- Company Name: Profound Logic Software
- Contact:
Re: Opening file on IFS
Using MS Office 2007 Excel, I was able to have it open a web URL by passing something like this to the Excel executable:
Code: Select all
http://myiSeries:8080/tiffs/boltst.csv
Who is online
Users browsing this forum: No registered users and 1 guest