1. Shirley Sanjuan
  2. PowerServer
  3. Wednesday, 4 October 2023 20:39 PM UTC

Hi, How can I read a file of Excel from Powerserver? 

Accepted Answer
mike S Accepted Answer Pending Moderation
  1. Thursday, 5 October 2023 20:19 PM UTC
  2. PowerServer
  3. # Permalink
nonsense. it works great in powerserver. been doing this stuff for years in powerserver including the old PS2020, but even better with new versions
Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 4 October 2023 20:52 PM UTC
  2. PowerServer
  3. # 1

HI Shirley;

  You would have two choices ...

  1. Since PS is Database only oriented, you would have to store the XLSX file in a DB Blob column and then perform a SelectBlob command in the PS Application.
  2. You could build your own Web API  using SnapDevelop (VS, etc) IDE where you have full scripting capabilities in C#. Then read the XLSX in C# code directly from an external file. Then return that to a PB App (or whatever calling App) as either a BLOB or Base64 data stream.

Regards ... Chris

Comment
  1. Shirley Sanjuan
  2. Wednesday, 4 October 2023 20:56 PM UTC
Hi Chris, Thanks, Do you have example of how to do that?
  1. Helpful
  1. Chris Pollach @Appeon
  2. Wednesday, 4 October 2023 20:59 PM UTC
Do you mean as a Blob or via a C# coded Web API?
  1. Helpful
  1. Shirley Sanjuan
  2. Wednesday, 4 October 2023 21:34 PM UTC
any one.
  1. Helpful
There are no comments made yet.
mike S Accepted Answer Pending Moderation
  1. Wednesday, 4 October 2023 21:32 PM UTC
  2. PowerServer
  3. # 2

just open the file directly from the users machine:

1. have your users save excel as tab or csv file then import that into datawindow/store

2. use ole to read (or write) excel: ConnectToNewObject("excel.application") You can use ole to open the file then save it as csv/tab delimited.  or you can read it cell by cell.

3. use a 3rd party dll or .net to read it directly into something like tab/csv format

4. use excel 'database' driver and open it using adodb via ole: ConnectToNewObject ( "ADODB.Connection" )  

 

---------------

if it's a lot of heavy processing that takes a very long time, then it probably makes sense to do the work on a server so you would upload the file then run a process (pb or .net or something) and return the results to the user.

Comment
  1. Chris Pollach @Appeon
  2. Wednesday, 4 October 2023 23:12 PM UTC
Hi Mike;

I think that Shirley's question is a bit ambiguous ... does she mean:

1) Process XLSX files in the "Middle Tier" and return them to the call App?

2) Process the XLSX files in the client App?

My answer was based on assumption #1 (like we could do in EAServer). ;-)

Regards .. Chris
  1. Helpful
  1. Armeen Mazda @Appeon
  2. Thursday, 5 October 2023 01:43 AM UTC
Adding to what Mike said, client-side for PowerServer 2022 is same as traditional PB so if it works in PB it will work is PS. There must be some config issue if not working.
  1. Helpful
  1. mike S
  2. Thursday, 5 October 2023 04:03 AM UTC
Mostly the same - the one thing you can't do is directly load excel into a datawindow/store using a transaction object with odbc excel driver to connect to it.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.