Hi, Please try with the full schema-jar, see http://poi.apache.org/faq.html#faq-N10025
Dominik. On Wed, Mar 25, 2015 at 9:19 AM, BRANDA Didier <[email protected]> wrote: > Hello, > > > > I'm using 3.11 poi for create xlsx files. > > I know how to create a XSSFAutoFilter, and I can use it manually when the > file is open under Excel. > The problem is that I don't find how to make a selection in the filter by > programming. > > At : > http://thinktibits.blogspot.fr/2014/09/Excel-auto-filter-criteria-Apache-POI-Example.html > I found this example : > > /* Step-1: Get the CTAutoFilter Object */ > CTAutoFilter sheetFilter=my_sheet.getCTWorksheet().getAutoFilter(); > /* Step -2: Add new Filter Column */ > CTFilterColumn myFilterColumn=sheetFilter.insertNewFilterColumn(0); > /* Step-3: Set Filter Column ID */ > myFilterColumn.setColId(1L); > /* Step-4: Add new Filter */ > CTFilter myFilter=myFilterColumn.addNewFilters().insertNewFilter(0); > /* Step -5: Define Auto Filter Condition - We filter Brand with Value of "A" > */ > myFilter.setVal("A"); > XSSFRow r1; > /* Step-6: Loop through Rows and Apply Filter */ > for(Row r : my_sheet) { > for (Cell c : r) { > if (c.getColumnIndex()==1 && > !c.getStringCellValue().equals("A")) { > r1=(XSSFRow) c.getRow(); > if (r1.getRowNum()!=0) { /* Ignore top row */ > /* Hide Row that does not meet Filter > Criteria */ > r1.getCTRow().setHidden(true); } > } > } > } > > But it seem that this code didn't work in3.11 > In jars of 3.11 I don't find CTFilterColumn Class > > Is there somebody that know how to make in 3.11 ? > > > > Thank you, Didier B > > > Post-scriptum La Poste > > Ce message est confidentiel. Sous reserve de tout accord conclu par ecrit > entre vous et La Poste, son contenu ne represente en aucun cas un engagement > de la part de La Poste. Toute publication, utilisation ou diffusion, meme > partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire > de ce message, merci d'en avertir immediatement l'expediteur. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
