tags:

views:

95

answers:

3

Hi,

A company is creating a web site for the organization I work for. Since the web site is still being developed, some modules are not yet there. For instance, in order to print data obtained from a query, one needs first to export it to Excel or Access. Then, from Excel or Access, it is important to do some adjustments (adjust columns width and rows height, modify titles, so on) to make it easy to print.

I would like to create a small web application that will avoid us doing those operations manually. Unfortunately, the other application is in JSP/Java while I only know ASP.NET/C#.

How can I retrieve all this data, which are either in Excel or Access, and reload them into my application for printing?

Thank you

A: 

This article explains reading from excel file using VB.

http://support.microsoft.com/kb/311731

Hope this helps

Charley
Using OLEDB has some issues, particularly with columns containing long (>255 character) text. Also, AFAIK, the OLEDB driver cannot read Excel 2007 files, only 2003 and below.
richardtallent
A: 

Have you considered writing a macro in Excel instead of trying to do everything on the server? Creating a macro in VBA isn't difficult, and you can distribute it as an Add-In to your users. Takes some good instructions for them to install it, but avoids all the potentially messy issues of import/export of Excel files.

richardtallent
A: 

This guy did a brilliant article on getting data from excel using ado.net, I have written a program based on his instructions and it is working fine with Excel 2007 files, and can handle very long column data as well. Link to article

tuanvt