Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0DA84200CCC for ; Fri, 21 Jul 2017 09:53:37 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 0C15F16CC56; Fri, 21 Jul 2017 07:53:37 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 522D116CC52 for ; Fri, 21 Jul 2017 09:53:36 +0200 (CEST) Received: (qmail 27722 invoked by uid 500); 21 Jul 2017 07:53:35 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 27711 invoked by uid 99); 21 Jul 2017 07:53:34 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 21 Jul 2017 07:53:34 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 15A82C0143 for ; Fri, 21 Jul 2017 07:53:34 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.499 X-Spam-Level: *** X-Spam-Status: No, score=3.499 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_SORBS_WEB=1.5, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 6qYH3nKc4rDv for ; Fri, 21 Jul 2017 07:53:32 +0000 (UTC) Received: from www390.your-server.de (www390.your-server.de [78.46.152.120]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id C526D5F6C6 for ; Fri, 21 Jul 2017 07:53:31 +0000 (UTC) Received: from [88.198.220.130] (helo=sslproxy01.your-server.de) by www390.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.85_2) (envelope-from ) id 1dYSkd-0002nb-Gf for user@poi.apache.org; Fri, 21 Jul 2017 09:53:31 +0200 Received: from [87.139.51.245] (helo=ga-berlin.local) by sslproxy01.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-GCM-SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dYSkd-00070W-9N for user@poi.apache.org; Fri, 21 Jul 2017 09:53:31 +0200 Received: from [10.255.130.1] (Unknown [10.255.130.1]) by ga-berlin.local with ESMTPA ; Fri, 21 Jul 2017 09:53:29 +0200 Subject: Re: Detect or remove auto filter To: user@poi.apache.org References: <2395f948-fbbc-5f70-d2a4-ea1047e3ada3@ga-gmbh.de> From: Samuel Stein Organization: =?UTF-8?Q?Geb=c3=a4ude_Automatisierung_GmbH?= Message-ID: <69475e64-a884-5fef-d33e-1385cc223816@ga-gmbh.de> Date: Fri, 21 Jul 2017 09:53:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------D87649A9AC42A05DE2977D93" Content-Language: en-US X-Authenticated-Sender: outbound@ga-gmbh.de X-Virus-Scanned: Clear (ClamAV 0.99.2/23582/Fri Jul 21 02:17:15 2017) archived-at: Fri, 21 Jul 2017 07:53:37 -0000 --------------D87649A9AC42A05DE2977D93 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Hello Greg, thanks for the fast answer and the good example. I forgot to mention that i have an .xls file and not an .xlsx. Is there also an internal api for auto filter? Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte Informationen enthalten. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht gestattet. This e-mail may contain confidential and/or privileged information If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden. On 20.07.2017 23:51, Greg Woolsey wrote: > You have to go down to the CT* classes for that info, POI doesn't have a > high-level API for it yet. Note this is a per-sheet setting, not > per-workbook. > > XSSFWorksheet xw = getTheWorksheet(); > if (xw.getCTWorksheet().isSetAutoFilter()) { > CTAutoFilter af = xw.getCTWorksheet().getAutoFilter(); > } > > You can then use it's ref property directly and parse it as a cell range > reference, or go look for the built-in named range that matches it (or > could be for a different advanced filter, see the JavaDoc): > > org.apache.poi.xssf.usermodel.XSSFName.BUILTIN_FILTER_DB > > All this can be inferred by following the source code in > XSSFSheet.setAutoFilter(CellRangeAddress) > > > On Thu, Jul 20, 2017 at 6:05 AM Samuel Stein wrote: > >> Hello folks, >> >> i have a question regarding Auto Filter. As far as i can see POI >> supports right now only setting an auto filter. >> >> Is there a way to detect if the spreadsheet has an active auto filter >> set and/or remove auto filter? >> >> Thanks in advance >> >> >> Samuel >> >> -- >> Diese E-Mail könnte vertrauliche und/oder rechtlich geschützte >> Informationen enthalten. >> Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich >> erhalten haben, >> informieren Sie bitte sofort den Absender und vernichten Sie diese Mail >> Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind >> nicht gestattet. >> >> This e-mail may contain confidential and/or privileged information >> If you are not the intended recipient (or have received this e-mail in >> error) >> please notify the sender immediately and destroy this e-mail >> Any unauthorised copying, disclosure or distribution of the material in >> this >> e-mail is strictly forbidden. >> >> >> GA Gebäude Automatisierung GmbH >> Technisches Büro Berlin >> Bundesallee 89 >> 12161 Berlin >> >> Amtsgericht Dortmund, HRB 9327 >> Geschäftsführer Rüdiger Plett >> --------------D87649A9AC42A05DE2977D93--