Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from excel sheet in csv format using Datatable.

Hello everybody,
 
I have an application in which i'am exporting data using Spread sheet and it is saving in excel comma separated variable format.
 
I want to show that data on control panel using data table, but it cannot import data from excel in csv format
 
so i want to know that,  can we export data  in excel format bypassing csv format.
 
or is there any option to read data from excel csv format.
 
Thanks
 
mantosh
0 Kudos
Message 1 of 2
(4,770 Views)
Hi Mantosh,

DataTable imports only from XLS files. The data you have appears to be a comma-separated, i.e., CSV data. Though Excel can open CSV files, it's not an XLS file -- until you save it as such.

So, the first option is to save the CSV data as an XLS file. If this cannot be done manually by a user, an Excel/VBA macro may be written to do this.

If the above isn't feasible, you have two options as I see it:

1. Read the CSV data as Text data. You will have to use DataSocket for this (search the forums). But it won't be pretty-looking: you'll see the data as you would in a Notepad.

2. Use the MS Office's SpreadSheet ActiveX control. this can display CSV data in an Excel format, using the CSVURL property. I just tested this and it works:




Hope this gives you some ideas.

-Khalid

Message Edited by Khalid on 05-03-2006 01:28 PM

0 Kudos
Message 2 of 2
(4,765 Views)