How can users paste tabular data into a web-based VB.NET app?

  • Thread starter The Red Knight Mike
  • Start date
T

The Red Knight Mike

* First post - please advise me if this should be posted to some other group *

Hi folks,

I work at a small government agency. We have contractors developing a VB.NET
app to capture chemicals and their concentrations, as found at hazardous
waste sites. Staff will be entering the info once the app is developed.

The staff often get electronic docs with this chemical and concentration
data existing as long tables in the doc. Format could be anything but is
often a Word doc, Excel ss, or PDF.

Our staff would really, really like to be able to simply cut and paste these
tables into our new VB.NET app, from whatever other electronic source. (In
fact, it's liable to make or break the app.) In particular, the app should be
able to 1) handle various origin formats (the doc types listed above) being
in the paste buffer, as well as 2) allow the whole source table (with dozens
of rows) to be pasted in one fell swoop. These tables have complex chemical
names and concentrations you don't want to make a single transcription error
on. (I think we can handle the possibility of different sources having data
"fields" in differing columns - that shouldn't be a problem.)

A key contact on our programming team says that "we present a 'dumb' html
data entry webpage; you can't just cut and paste a whole table into a cell of
it".

I can't help but think there must be *some* way to accomplish this...
perhaps, instead of copy and paste per se, the user would copy from the
source, then click some sort of control in the VB.NET application, which
would fire some applet whose purpose is to process the paste buffer and
populate the data into our target data fields.

As you can see, I only barely know some of these technical terms. But I
can't help but think there must be some way to paste / process a table in the
paste buffer. Could anyone please advise us re: possible solutions? It'd be
greatly appreciated!

Mike
Atlanta GA
 
N

Nathan Sokalski

If you want this to be able to be done using a web application, my
suggestion would be to create a page that takes the following steps:

1. Allows the user to upload the data file
2. On the postback, the data from the uploaded file will be imported into
wherever you want

This will allow you do avoid forcing the user to take any extra steps in
preparing the data, as well as allow you to do all the data transferring on
the server-side. You may also want to have the application delete the
uploaded file after the data has been imported so you don't need to worry
about having a bunch of extra uploaded files on your server. But another
question I would like to ask you is whether you really want a web-based
application or a desktop network application? Anyway, I have told you my
suggestion, so good luck!
 
T

The Red Knight Mike

Thanks very much for your input, Nathan.

You were mentioning "uploading a data file". Note that we specifically want
to cut and paste, not upload a data file. Thus we need a control that can
read from the paste buffer. Then a method - hopefully one pre-written - that
can parse through whatever is in the paste buffer, to determine cell and row
boundaries.

With a little experimentation, I found that simply cutting and pasting from
Word and Excel into a large, empty text box in this web app resulted in
pretty usable results: cells were separated by tabs, and rows by carriage
returns. However, pasting from PDFs put spaces instead of tabs between cells,
which is a problem, because a lot of the data has spaces in it (names, etc.).
Cutting and pasting from a web html table is also a little problematic, but
if the user c&ps into Excel first, then c&ps that into the web textbox, it
works ok.

Any further thoughts from anyone are greatly appreciated!
 
N

Nathan Sokalski

It sounds like you have a way to do this for some file formats, but not
others. A partial solution for this might be to also ask the user what file
format they are copying & pasting from. But I am pretty sure that there is
no solution for the formats that use spaces, because I am pretty sure there
is no way to read from the paste buffer in a web application (probably for
security reasons). There may be a way using an ActiveX control or Java
Applet (I've never written ActiveX controls, and it's been a long time since
I ever wrote a Java Applet), but not in the web application itself. I wish I
had a more useful answer, but to the best of my knowledge there isn't one.
--
Nathan Sokalski
(e-mail address removed)
http://www.nathansokalski.com/

The Red Knight Mike said:
Thanks very much for your input, Nathan.

You were mentioning "uploading a data file". Note that we specifically
want
to cut and paste, not upload a data file. Thus we need a control that can
read from the paste buffer. Then a method - hopefully one pre-written -
that
can parse through whatever is in the paste buffer, to determine cell and
row
boundaries.

With a little experimentation, I found that simply cutting and pasting
from
Word and Excel into a large, empty text box in this web app resulted in
pretty usable results: cells were separated by tabs, and rows by carriage
returns. However, pasting from PDFs put spaces instead of tabs between
cells,
which is a problem, because a lot of the data has spaces in it (names,
etc.).
Cutting and pasting from a web html table is also a little problematic,
but
if the user c&ps into Excel first, then c&ps that into the web textbox, it
works ok.

Any further thoughts from anyone are greatly appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top