Running a pc Command that relies on host Command execution

Use this board to ask questions or have discussions with other Rich Displays users.
Post Reply
Stuart
Profound User
Posts: 30
Joined: Tue Apr 17, 2012 4:37 pm
First Name: Stuart
Last Name: Leonard
Company Name: Summit Holdings
Phone: 813-665-6060
Address 1: 2310 Commerce Point Drive
City: Lakeland
State / Province: Florida
Zip / Postal Code: 33594
Country: United States
Contact:

Running a pc Command that relies on host Command execution

Post by Stuart »

I have a dropdown box that is attached to a table (subfile)

There are 2 options, and one of those options needs to run both a host Command and a pc Command
The iSeries (RPG) program runs a host command to create a PDF file
The pdf file then needs to be passed as a parameter to the pc Command.
Since the pdf is being generated thru a host command, based on user selection,
and then a PC command needs to run to process the file, how can I achieve all this
with the onchange event of the drop down box? By the way, the pdf file name is variable, so I need to pass control to the RPG program to create the file, and then run a javascript (runPCCommand) that will process the command string (within a hidden field) that is created in the RPG program.

I could download a PDF creation package (such as lowagie PDFWriter), and then accomplish all thru a pc Command call, however, my employer would prefer that I use the utility that we already have on the iSeries to create the pdf,

Can all this be done with one button click? I am beginning to think that I may need 2 events, one to create the PDF, and the other event to send the file.
User avatar
Brian
Profound Logic Staff Member
Posts: 286
Joined: Thu Apr 14, 2011 10:23 am
First Name: Brian
Last Name: May
Company Name: Profound Logic Software
Contact:

Re: Running a pc Command that relies on host Command execution

Post by Brian »

Stuart,

It really depends on what you are wanting to do on the PC side. If it is just to open the pdf, you could handle it one of two ways:

1. Have your program call the program to generate the PDF and then use STRPCCMD to open it for the user.

2. (My preferred method) Write a CGI program that will generate the PDF and stream it to the browser. Then your js can open a new browser tab and just call this program.


If you need to run some process on the PC against the file and are not just looking to display it, then option one is probably your best choice. It will require a trip back to the server to do it however.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest