cancel
Showing results for 
Search instead for 
Did you mean: 

Import File / Appeon / .Net Assembly / LibXL

Former Member
0 Kudos

Greetings All,

I need to provide my users with the ability to import a file (spreadsheet) in my Appeon and process it in a datawindow.

In PB I have had good success using a Winform Target to be able to call LibXL.Net.DLL to open a spreadsheet and read and write to it using a PowerBuilder Winform Client.

And now I am wondering if that capability might exist in Appeon.  The documentation says that I can use a Winform target, but states that I have to re-write my code and possibly use something called the AppeonDotNetComponent.

So before I go any further down the rabbit hole, does this sound at all feasible?

If so, can someone point me in the right direction?

If not, is there some other way to open a file in the Appeon Web Client and read the spreadsheet so I can import the data?

Thank you!!

Paul

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Paul;

  As another alternative ... What about using a PB based Web Service to Read + Write to the Excel spreadsheet using the "LibX.Net.DLL"? The PB Web Service will run like a WebForms application ... A "kissing cousin" to the Winform application. Both of these generate C# BTW.

Regards ... Chris

Former Member
0 Kudos

Thanks Chris!

Now I am way down the rabbit hole.

Question: Does that mean that I cannot use the libxl.net.dll in the Appeon client?

Question: If I do go via web service, how do I get the spreadsheet to where it needs to be to get processed and how do I get it back to the client with entries via libxl.net.dll?

Question: Can I have the client save the spreadsheet as comma delimited and simply import into a datawindow for processing?

Thank you,

Paul

Former Member
0 Kudos

Yes, importing as tab or comma delimited will work very nicely.  mostly just like PB.  Note that appeon is limited in importing comma delimited to full file only .  while tab delimited can be done either as full file or a row/line at a time.

the other option is to use excel directly via the excel com objects to import/export to excel.  this means the client would require excel to be installed:

ioo_excel = CREATE OleObject

ll_rval = ioo_excel.ConnectToNewObject("Excel.Application")

....

Former Member
0 Kudos

Thanks M.

Would you happen to know where I can find a code example for either importing from .csv or connecting to the Excel client?  I don't have a problem with telling the client that they have to have Excel installed.

Best,

Paul

Former Member
0 Kudos

Q1: Does that mean that I cannot use the libxl.net.dll in the Appeon client?

A1:  Appeon Mobile:  NO

       Appeon Web: Should work via Appeon`s .Net assembly support

                            (as long at there is no visual aspect to this DLL).

Q2: Does that mean that I cannot use the libxl.net.dll in the Appeon client?

A2: Have the Web Service return a Blob.   -OR-

      - Do what I do in my imaging applications & save the datastream to a Blob column

      - Then use a Select Blob directly from your Appeon code

Note: Using this approach you can support Appeon Mobile as well. 

Q3: Can I have the client save the spreadsheet as comma delimited and simply import into a datawindow for processing?

A3: YES 

Former Member
0 Kudos

look up importfile and importstring in powerbuilder help. 

the basic command is:  dw_1.importfile("c:mytextfile.csv")

if you google powerbuilder and excel you get a lot of hits such as:

http://stackoverflow.com/questions/11223315/write-and-read-from-excel-using-powerbuilder

Former Member
0 Kudos

Thanks M, Thanks Chris.

I really, really, really want to use the LibXL.Net.Dll and there is no visual aspect to it.  If I can provide some existing code for how I use it, can you help me with figuring out how to instantiate it, Chris?

Thank you!!  Paul

Former Member
0 Kudos

Hi Paul;

  Always happy to take a look at your code however, I don't have the control .Net DLL's to run anything. So I'm not sure how much help I can actually be.

Regards ... Chris