This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DEVELOPERS FORUM - import excel sheet data

eknath - Tuesday, September 22, 2015 7:27 AM:

Hi all,

   I want to import Excel data to an Item Type..

any solution plz help me

thanks in advance

 



John Example - Tuesday, September 22, 2015 8:16 AM:

Hi eknath,

For your needs you can use OleDB within Server-side method. For example you can grab data from .xlsx into dataSet this way:

 

public static DataSet getExcelData(string filePath, string sheetName)

{

string sql = "SELECT * FROM ["+sheetName+"]";

string excelConnection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + filePath + ";Extended Properties=Excel 12.0;";

 

using (OleDbDataAdapter adaptor = new OleDbDataAdapter(sql, excelConnection))

{

DataSet ds = new DataSet();

adaptor.Fill(ds);

return ds;

}    

}

 

Then you just need to create new Items for each row you'll get.

Btw, do not forget to add System.Data.OleDb reference to a method-config.xml file (C:Program Files (x86)ArasInnovatorInnovatorServer).



zahar - Tuesday, September 22, 2015 8:25 AM:

If you are an Aras subscriber you may use the ‘Batch Loader’ tool to load your data, but you’ll have to know what you’re doing for more complex operations such as loading relationships.
 
If you are not an Aras subscriber, you have the following options:

·         Write your own application that will parse the Excel and import into Aras using IOM

OR

·         Use a tool we wrote to import any data from Excel to Aras using a simple GUI interface. Please contact Sagi - He is handling this tool - [email protected]