Excel to Record List

Excel to Record List

  
Hello,

I am trying to import an excel file to a record list, this is normally an easy task but there is a problem, I have many diferent excel formats to import, all of them have an header but the header column names are diferent in all the excel files.
What I want to do is, to import ignoring the column names... I have created a structure with 15 text fields, Column1, Column2....... Column15.

It does not works... I get this error:

None of the column headers match with the record attributes.

How can i get this to work? Please help me.


Thanks
Pedro
I think the column names of the structure must match the names in the excel file.
Try changing the excel header to COLUMN1, ... ( I think they even have to be in upper case)
Hi,

Thanks for your reply.

I cannot  change the excel files, they are exported from an application and are not ment to be oppened and edited in excel.

Any other idea? Maybe there is an extension that can help me achieve what i need?

Thanks
no one?
Build an extension that reads the Excel columns by index an then fill a RecordList with your structure.

You can use a free .NET library like the Excel Data Reader:
http://exceldatareader.codeplex.com/

I
t's very easy to use an they have examples there.
Pedro Moreira wrote:
Hello,

I am trying to import an excel file to a record list, this is normally an easy task but there is a problem, I have many diferent excel formats to import, all of them have an header but the header column names are diferent in all the excel files.
What I want to do is, to import ignoring the column names... I have created a structure with 15 text fields, Column1, Column2....... Column15.

It does not works... I get this error:

None of the column headers match with the record attributes.

How can i get this to work? Please help me.


Thanks
Pedro
 
 
its not going to work. the excel columns headings and database column headings must be same. then only its going to work
Pedro Moreira wrote:
Hello,

I am trying to import an excel file to a record list, this is normally an easy task but there is a problem, I have many diferent excel formats to import, all of them have an header but the header column names are diferent in all the excel files.
What I want to do is, to import ignoring the column names... I have created a structure with 15 text fields, Column1, Column2....... Column15.
 
 Hello Pedro,

This error is generated since the numer of colums in the excellist is larger than in your record/structure (or it was the other way around). The name of the colums doesn't need to match the name of the record/structure. The only thing that need to match is that the number of the colums in the excel list is the same as the number of colums in the record/structure. I thought there could even be more colums in the excellist possible (or what I said before: the other way around). So the only thing you should check is that the number of colums is the same.

Kind regards,
Evert

EDIT:
Just checked the logic, the number of colums in the excellist must be the same as the record/structure attributes. When there are more colums in the excellist you get the error as you write.