Click here to Skip to main content
15,887,474 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Java
Keywords key= new Keywords();
ArrayList a = new ArrayList(); 
		try{
			
			  FileInputStream inputStream = new FileInputStream(new File("path.xlsxFile"));
		         
		        Workbook workbook = new XSSFWorkbook(inputStream);
		        Sheet firstSheet = workbook.getSheetAt(0);
		        Iterator<Row> iterator = firstSheet.iterator();
		         
		        while (iterator.hasNext()) {
		            Row nextRow = iterator.next();
		            Iterator<Cell> cellIterator = nextRow.cellIterator();
		             
		            while (cellIterator.hasNext()) {
		                Cell cell = cellIterator.next();
		                switch (cell.getCellType()) {
	                    case Cell.CELL_TYPE_STRING:
	                        System.out.print(cell.getStringCellValue());
	                        break;
	                    case Cell.CELL_TYPE_BOOLEAN:
	                        System.out.print(cell.getBooleanCellValue());
	                        break;
	                    case Cell.CELL_TYPE_NUMERIC:
	                        System.out.print(cell.getNumericCellValue());
	                        break;
	                }
	                System.out.print(" - ");
	            }
	            System.out.println();
	        }
	         
	        workbook.close();
	        inputStream.close();
			
for(int i=0;i<a.size();i++){
			if(a.get(i).equals("openbrowser")){
				String keyword = (String)a.get(i);
				String data = (String)a.get(i+1);
				String objectName = (String)a.get(i+2);
				String runmode = (String)a.get(i+3);
				System.out.println(keyword);
				System.out.println(data);
				System.out.println(objectName);
				System.out.println(runmode);
				if(runmode.equals("yes")){
					key.openbrowser();
				}
		 }


What I have tried:

tried to access the data from .xlsx file and pass those data to a web browser.
Posted
Comments
Richard MacCutchan 10-Oct-18 11:51am    
The message is quite clear, your Keywords class does not contain a method named openbrowser.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900