Page 1 of 1

Uploading an Excel to a file?

Posted: Thu Dec 03, 2015 6:09 pm
by cproctor
Good afternoon. I know we can add a link to a screen to export data to an excel spreadsheet. Is there the ability to go the other way? In other words, we have users who have data on a spreadsheet and they would like to import it into a file. Obviously, this ability would require mapping a column to a field and I'm guessing some possible validation. I'm just wondering if this is even possible.

Thanks!

Re: Uploading an Excel to a file?

Posted: Thu Dec 03, 2015 10:04 pm
by Paul
Chris,

We do this using Scott's port of POI to RPG (https://www.scottklement.com/poi/). You are right, you need to do your mapping etc within the RPG. Use the File Upload widget (under Input Controls in Designer) to load the Excel, then process it in RPG.

If anyone has a better way please share!

Paul

Re: Uploading an Excel to a file?

Posted: Fri Dec 04, 2015 10:50 am
by Scott Klement
Profound UI does not have anything that specifically reads an Excel file.

You can use our File Upload widget to allow the user to upload files (of any sort) from their PC to IBM i. You could use the 'allowed type' property to restrict it so that it only allows Excel files to be uploaded if you wish. The upload widget will put the file into the IFS for you.

It will be up to you to interpret the file. If you ask the user to upload a CSV file, you could use something like IBM's CPYFRMIMPF to interpret it, or a tool like my CSVR4 program, or something like that. (This is the format that Profound UI exports...)

Or, if the user uploads a normal Excel spreadsheet in XLS or XLSX format, then you could use a tool like POI (as Paul suggests) to read the file.

In any case, it is not a feature of Profound UI to interpret the file, you'd need to code this yourself using one of the above methods.