Hi all,
I have added different attributes in all the EPC's. I would like to add values to that attributes in all EPC's at one go through excel instead of doing manually? Can we do that? I never imported data through excel in ARIS. Many thanks if someone can help me to solve this problem.
Thanks & Best Regards,
Srinivas.
ephem ya on
Hi,
I have this problem 6months ago. And I made this for read all the XLS File :
function FaireImport() { var test = true; var tab_SelecFile = new Array() ; // DialBox Pour recup un fichier xls tab_SelecFile = Dialogs.getFilePath("","*.xls",Context.getSelectedPath(),"Selection du fichier Excel",0); if(tab_SelecFile==null || tab_SelecFile==undefined ) { Dialogs.MsgBox("Aucun fichier selectionné !") test = false } if ( test == true ) { var ParamFile= null ; ParamFile= tab_SelecFile[0] ; //FICNAME = ParamFile.getName() ; var xlsReader = Context.getExcelReader(ParamFile.getData()) // XlsWorkbook var fichierExcel= new fichierXLS(xlsReader ) TraiterFichierImport( fichierExcel ) } } // modelisation memoire d'un fichier xls function fichierXLS(xlsReader) { this.fichier = xlsReader ; this.listeFeuille = new Array(); this.init = function() { var listeFeuille = new Array() listeFeuille =this.fichier.getSheets() ; //recup des lignes for(var i = 0 ; i< listeFeuille.length;i++) { this.listeFeuille.push( new feuille_clss(listeFeuille[i],i)); // i = 0 avant } } this.init(); } function feuille_clss(feuille, Objfeuille) { this.feuille = feuille ; this.nomFeuille = feuille.getName() ; this.num = Objfeuille ; this.listeLigne = new Array(); this.init = function() { var i = 0 ; while( i<this.feuille.getLastFilledRowNum()+1 ) { if(this.feuille.getRowAt(i)!=null && this.feuille.getRowAt(i)!=undefined ) { new_ligne = new ligne_clss(this.feuille.getRowAt(i),i) ; this.listeLigne.push(new_ligne); } i++ ; } } this.init(); } function ligne_clss(ligne, numLigne) { this.ligne = ligne ; this.num = numLigne ; this.listeCellules = new Array() ; this.ligneStr = "" ; this.init = function() { if(this.ligne.getLastCellNum() >0) { var i = 0 ; // recup des cellules. while( i< this.ligne.getLastCellNum() ) { var currCell = new cellule_clss(this.ligne.getCellAt(i),i) this.ligneStr += currCell.texte+ ";" this.listeCellules.push(currCell ); i++ ; } } } this.init(); } function cellule_clss(cellule, numCellule) { this.cellule = cellule ; this.texte = "" ; this.col=0 this.num = numCellule ; this.init = function() { if(this.cellule !=null) { this.texte = this.cellule.getCellValue ( ) ; this.col= this.cellule.getCellIndex ( ) ; } else { this.col= this.num ; } this.cellule =null ; } this.init(); }Here you got all your XLS File in class and you can get all informations you need with :
function TraiterFichierImport (ObjetFichierExcel){ //ObjetFichierExcel.listeFeuille => list of sheets //ObjetFichierExcel.listeFeuille[0].listeLigne => sheet 1 , list of lignes //ObjetFichierExcel.listeFeuille[0].listeLigne[0].listeCellules => sheet 1 , ligne 1, list of cells String str = ObjetFichierExcel.listeFeuille[0].listeLigne[0].listeCellules[1].texte; // here you have the text in the sheet 1, ligne 1, cell 2 //[...] }And you can search in your XLS File the information you need.
PS : sorry for script and comments langage , I'm french