views:

98

answers:

3

I have a website where I allow businesses to register what products they sell individually. Then a consumer can online and search for a product and receive a list of all the shops where it's currently selling.

Although they can upload one product at a time, I want to allow businesses to mass upload things they offer.

I was thinking of using a excel spreadsheet. Have them download the template, and then have them upload the filled in excel sheet.

Others have suggested telling them to create a CSV file, but that is counter-intuitive in my honest opinion. Most likely a secretary will be creating the product sheets and she won't have a clue about what a CSV is.

What is the best way to approach this?

A: 

While I personally don't like Excel very much, it seems to be the best accepted format to do such things (involving a manual process).

My experience is that CSV breaks easily, for instance it uses the regional settings to determine the separator which can cause incompatibilities on either the client or the server side. Also, many people just save the file in any Excel format because they just don't know the difference.

Creating the files can be pretty easily done with some XSLT (e.g. create XMLSS format files, which are "XML Spreadsheet 2003" format).

You may also want to have a look at the Excel Data Reader on Codeplex for parsing the files.

Lucero
+2  A: 

Well, it partly depends on the businesses. If they are medium or large businesses, they'd probably rather submit the data via a webservice anyway - then they don't have to get a human involved at all, after the initial development. They can write an application to periodically suck information from their (inevitable) database of products, and post to your web service.

If you're talking about very small companies without their own IT departments, that's less feasible, and either Excel or CSV would be a better approach. (As Caladain says, it's pretty simple to export to CSV... but you should try from a number of different spreadsheet programs as they may well have different subtleties in their export format. Things like text encoding will be important as well.)

But here's a novel idea... how about you ask some sample companies what they would like you to do? Presumably you have some companies in mind already - if you don't, it's potentially going to be pretty hard to make sure you're really building the right thing.

Find out how they already store their product list, and how they'd want to upload it to you. Then consider how difficult that would be, and possibly go back to them with something which is almost as easy for them, but a lot easier for you to implement, etc.

Jon Skeet
I've planned this for small shops with no IT and medium sized shops with a computer (but no database); it doesn't do any damage to plan ahead though, and that webservice idea is pretty great for future design. I'll keep that in mind for sure!
Sergio Tapia
A: 

Reading in an Excel file is actually pretty easy with ODBC. Tutorial on it.

Brian