How to open a spreadsheet in XLS on QNTC server

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
RonHudson
New User
Posts: 1
Joined: Fri Feb 17, 2017 12:00 pm
First Name: Ron
Last Name: Hudson
Company Name: InVue Security
Contact:

How to open a spreadsheet in XLS on QNTC server

Post by RonHudson »

I would like to provide the user with a method of opening a spreadsheet in excel for them to edit and save back to the windows server.

I can accomplish this in the green screen by displaying string 'FILE://INVUE222\MIS\QATEST\TEST\TESTXLS.XLSX ' and them double clicking on it.

How can this be done with a Rich Display file?

Thanks
Ron
Scott Klement
Experienced User
Posts: 2711
Joined: Wed Aug 01, 2012 8:58 am
First Name: Scott
Last Name: Klement
Company Name: Profound Logic
City: Milwaukee
State / Province: Wisconsin

Re: How to open a spreadsheet in XLS on QNTC server

Post by Scott Klement »

It's important to understand that a FILE:// URL does not use QNTC, or anything from the IBM i. It is your PC making a direct connection (using Microsoft Windows, not IBM i) to a local disk resource. Due to "Windows Networking" (technically, Server Message Block (SMB) protocol) it can access files over the network.

Web browsers won't allow that. I'll explain why:

A web browser can, actually, access a file:// URL, but only if the web page itself was served from a file:// URL. Imagine what would happen if any web page, anywhere on the Internet, could access file:// URLs! Any page on the Internet would be able to read the files on your hard drive!!

But, in reality, that's what you're doing with green-screen. When you set up IBM i Access (or whichever 5250 emulator you use) you're giving that emulator full access to your PC. You're basically saying "I fully trust this IBM i to do whatever it likes with my PC". We accept that in green-screen, because we only connect our 5250 emulators to systems that we know and trust. Not so with a web browser! You connect to web pages all over the Internet, and many of them you don't know much about. It's important that a browser limits these web sites from what they can do to your PC.

Anyway...

For the browser, you have a few options:

1) You can have everything go through your IBM i. Instead of using a file:// URL, you can download from the IBM i to the PC with the pui.download() API or similar. You can upload back to the IBM i with one of the upload widgets. The IBM i then does the work of saving this to another machine if that is important to you. The disadvantage to this approach, if the spreadsheets are on a different machine, is that IBM i's QNTC support is nowhere near as stable as Microsoft's SMB support... but there are other ways to to transfer to/from your IBM i that might work better? NFS, for example.

2) You can run an HTTP server on the remote system rather than using SMB. This way, you could use URLs that accesss the Excel sheets directly on the remote server. You would need to use an upload program on the remote server (rather than our file upload widget) in this case. This might involve more work, but would be much more reliable than option 1, in my experience.

3) You could use something like STRPCCMD/runPCCommand() to open the spreadsheets, and ask that the user does a "Save" back to the original location. This would be easy, but is not very web-like. It also requires software to handle PC Commands being added to each computer, either via a Java Applet (which is deprecated, and not available in many newer browsers) or via installing a PC program like our PC Command Listener.
Post Reply

Who is online

Users browsing this forum: danielritzmann and 0 guests