Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread Importing Data From CSV/Excel Files
Sat, Apr 12 2014 8:17 PMPermanent Link

Frederick Chin

Is it possible for an EWB application to import data from CSV/Excel files in a local computer?

Frederick
Sat, Apr 12 2014 9:11 PMPermanent Link

Raul

Team Elevate Team Elevate

On 4/12/2014 8:17 PM, Frederick Chin wrote:
> Is it possible for an EWB application to import data from CSV/Excel files in a local computer?

Not directly (EWB is a javascript running in a browser so AFAIK there is
no way to access local files). However there are couple of options:

1. You could upload the file to the server and then EWB can just
download it again. This does mean you'd need some (minimal) server side
code.

2. if CSV content is not large you could have the user paste it into a
memo and parse it from there. Not the best user experience but might be
an option.

Raul
Sun, Apr 13 2014 10:48 AMPermanent Link

Frederick Chin

Raul wrote:

/*
1. You could upload the file to the server and then EWB can just
download it again. This does mean you'd need some (minimal) server side
code.
*/

This could be an option. After the user uploads the file, can EWB read it from the server and store the contents into the database?

CSV seems straightforward (I think) but Excel seems difficult. Is EWB up to it?

Frederick
Sun, Apr 13 2014 1:48 PMPermanent Link

Raul

Team Elevate Team Elevate

<<
Frederick Chin wrote:
is could be an option. After the user uploads the file, can EWB read it from the server and store the contents into the database?

CSV seems straightforward (I think) but Excel seems difficult. Is EWB up to it?
>>

Actually it's best to have the server to have the  database - EWB runs in the browser so there is no real storage (html5 local storage is the only option i can think of but it has number of downsides). EWB can query any data really using the server request.

Yes, CSV is quite easy. Excel is trickier but it's the back-end server that needs to read it, not ewb.  So additional step would be for the server side to take the uploaded file and store it in database, converting from csv or excel as needed (i haven't had to use any excel myself for this but AFAIK there are number of for example delphi components capable of reading excel files).

So the process could be something like this:
1. EWB app uploads the file
2. Server components takes the file and reads it and stores data into server side database
3. EWB app can now query the server for actual database data and allow user to view/edit etc. (edirs of course need to be posted back to server but EWB has database operations already built-in).

This also ensures that user can access it from any device/browser and data is there.

Raul
Sun, Apr 13 2014 3:03 PMPermanent Link

Walter Matte

Tactical Business Corporation


I created a Client EWB form that uploaded an Excel spreadsheet to the backend Server - The Server I wrote using  RealThinClient components, in Delphi - using EWB Delphi Server  would do same thing... I saved the spreadsheet to disk on server and used NativeExcel Delphi component to read and process the spreadsheet.  Same thing to process CSV...

Walter
Sun, Apr 13 2014 8:23 PMPermanent Link

Frederick Chin

Walter Matte wrote:

/*
I created a Client EWB form that uploaded an Excel spreadsheet to the backend Server - The Server I wrote using  RealThinClient components, in Delphi - using EWB Delphi Server  would do same thing... I saved the spreadsheet to disk on server and used NativeExcel Delphi component to read and process the spreadsheet.  Same thing to process CSV...
*/

As I imagined it, there is no escaping using 3rd party components to get this done.

I think that for this requirement, I will write a Windows app using Delphi, read both the CSV and Excel files locally and send the data straight into the MySQL database.

Frederick
Mon, Apr 28 2014 10:41 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Frederick,

<< I think that for this requirement, I will write a Windows app using
Delphi, read both the CSV and Excel files locally and send the data straight
into the MySQL database. >>

If you don't need the portability of a web application, then you *should*
just use a desktop application.  On the other hand, if you need the
application to be accessible by anyone from anywhere (within the
authorization scope), then you should consider using a web application.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Apr 29 2014 4:14 AMPermanent Link

Matthew Jones

And of course one of the nice things about going to a server/client system is that
you can have multiple clients. Have the desktop application do to the parsing and
interpreting and then upload to the server, and then the display and management can
be done from EWB.

/Matthew Jones/
Image