I am astonished, we cannot find a simple way to import a workbook or a worksheet into a wingrid. we are working with 2007.3 but we cannot find a way to simple import as we can easily export to excel.
Is it not implemented? do we have to manually import the worksheet data cell by cell???
please, advise
There is nothing built-in to the grid to do this. This is really not the grid's purview. The grid has no way to interpret an Excel sheet as data. What you would need to do is load the data from your Excel sheet into some data source that the grid can use, like a DataSet, IList, or IBindingList.
well, that is not what you advertised!
Please, check your 2007.3 brochure, it explicitely says:
http://download.infragistics.com/marketing/NetAdvantage/NET/NA73Brochure.pdf
"Our grids provide developers with the power and flexibility necessary to create compelling data display and entry applications in both Windows Forms and Web environments."
Additionally, I remember some pics in the what's new documents with nice arrows telling that it was possible to import excel into the grid capturing everything, not only the data.
What shall we do now? do the work you claimed was in the release or you kindly send us a patch with it built in?
This is not serious at all!
Hi Nicloas,
I took a look at the sample and it looks like this sample is written to just read in any Excel data with no notion of what the resulting data structure should be. Excel doesn't really have any notion of a data type like a DataTable has. So there's no way for a generic sample like this to interpret dates as dates, since Excel just stores dates as doubles.
If you know what the structure of your data should be, then you could create a DataTable with columns that have the appropriate data types and then when you read in the Excel data, you could convert the Excel values into the appropriate type as you go.
For dates, you would use the Infragistics.Excel.CalcEngine.ExcelCalcValue.ExcelDateToDateTime method to convert the value from a double into a DateTime.
Jason, i already test your example, and it work fine but when I receive dates and double values it doesn't work. They are formated to integer!
I looked inside object "cell", but there isn't any properties to resolve it.
Please help with this error.
Thanks!
Nicolas
Yes, it would be much easier if your object model had an API where I could supply a dataset and an XLS file and not have to write all of this iteration garbage.
If I can tell you the structure of how the data in the import file is going to be, then why should I have to implement code to iterate through workbook, worksheets, cells, and rows to create a dataset?
I just had different expectations when reading how the ultraGrid supports excel import, especially since your export API is a 1 liner. This would be like .NET touting how easy it is to work with POP3, when all they have done is abstracted the network communications and none of the MIME parsing.
Hi,
If I understand correctly, what you are asking is exactly what this sample does:
http://download.infragistics.com/users/samplecode/excelio.zip
It uses our Excel library API to read data to or from Excel.
Is there something that is missing that would make this easier?
Thanks for any feedback,
Jason
I am a little frustrated with this same topic. I understand the complexity of manipulating excel, but I would think you (Infragistics) could invest more effort into handling simple scenarios.
For example, I need to dump a grid out to excel, let the user modify the data, and then reimport the data into the grid; the structure will not change. Could you not create an API around importing data from a known excel structure? In this case it is known because your API's generated the export.