java - Specify File Path in Formula String in POI -


im new poi , have requirement search given list of strings in 2 different excel sheets have occurence of search strings, 1 or more times.

now, im using cell itereator iterate through rows search strings,

for (string searchstring : searchlist){ list<row> matchedrows = getmatchedrows(searchstring);  

}

public list<row> getmatchedrows(string searchstring) list<row> rowsmatched = new arraylist(); (row rowofsheet : worksheet) { if(rowofsheet.getcell(index).getstringcellvalue().equalsignorecase(searchstring)) {     rowsmatched.add(rowofsheet)            }      } } 

but performance getting affected have huge records in excelsheet searchlist. tried use "match" formula index of matching row using evaluator, couldnt gt correct syntax, when try execute following:

 "match('c:\\files\\[file1.xlsx]sheet1'!$a$2,'c:\\files\\[file2.xlsx]sheet2'!$b$2:$b$741,0)" 

this gives me following exception:

 exception in thread "main" java.lang.illegalargumentexception: invalid sheetindex: -1. @ org.apache.poi.ss.formula.sheetrefevaluator.<init>(sheetrefevaluator.java:39) @ org.apache.poi.ss.formula.operationevaluationcontext.createexternsheetrefevaluator(operationevaluationcontext.java:97) @ org.apache.poi.ss.formula.operationevaluationcontext.getref3deval(operationevaluationcontext.java:249) @ org.apache.poi.ss.formula.workbookevaluator.getevalforptg(workbookevaluator.java:656) @ org.apache.poi.ss.formula.workbookevaluator.evaluateformula(workbookevaluator.java:527) @ org.apache.poi.ss.formula.workbookevaluator.evaluateany(workbookevaluator.java:288) 

how specify complete file path in formulae string. refrred following bt not working out me.

http://stackoverflow.com/questions/10915475/java-poi-xssf-formulaevaluator

how solve this. suggestions , solutions helpful. in advance. please give solution asap need badly.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -