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 54575200C70 for ; Thu, 20 Apr 2017 00:26:58 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 52D2A160BAA; Wed, 19 Apr 2017 22:26:58 +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 9CF90160B9C for ; Thu, 20 Apr 2017 00:26:57 +0200 (CEST) Received: (qmail 91687 invoked by uid 500); 19 Apr 2017 22:26:56 -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 91675 invoked by uid 99); 19 Apr 2017 22:26:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Apr 2017 22:26:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 1839A1857B2 for ; Wed, 19 Apr 2017 22:26:56 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.396 X-Spam-Level: X-Spam-Status: No, score=-0.396 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 6wK-JgQ2rufN for ; Wed, 19 Apr 2017 22:26:53 +0000 (UTC) Received: from mail-io0-f173.google.com (mail-io0-f173.google.com [209.85.223.173]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id CEA725FBA0 for ; Wed, 19 Apr 2017 22:26:52 +0000 (UTC) Received: by mail-io0-f173.google.com with SMTP id a103so41014696ioj.1 for ; Wed, 19 Apr 2017 15:26:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qV4RUqTvLtM2BAf8PWN09/0U/35b5vrJCXo3Tyx2zkw=; b=TNH9VAVMQ1n3PKGn5vvBfKzmmqo8gqGcjMy51tP9nEH2wSn51YjBhbrinQ6RIH7J5v 54uJ8nroGRF87KRZX5PmP3nqgXnBf33ClcBMwVgQNnBWlYRRkXGpLo7t0c7LU4x/qOHz FXbLgUQaQOAEM6riattIT0iG6DD6H0/azr90DBGItcUG0IQj+0pIZjDF1vE1pmH0mQta IWyVk6MtlLb0y0KIhUnxPO7F0vOFeXSrL1yxcztGZQKTBMLo5adkQ3oQc9jTzP67p/mD aupeHGusA/AofhFtW4fO3yjbd8+gvsPVoxHqE6TNVxg6Nd843zh0pqNCZebPddJQEOdD d12g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qV4RUqTvLtM2BAf8PWN09/0U/35b5vrJCXo3Tyx2zkw=; b=OsLZ0lFpCTnvS132yMxVzXqO/h+4hBurL9JAhmf7ysNBvfVD8P7yYOKMvy28cykLiY lDATtg1sLz1dCl9g5saNZl956Mc7O4yfd1OmlFiYz99XtSHGG713A/efnyPRFqpHlaxn m6xytfg6fHcVrf2jyI2Oq0Hg+aNczlnAzEvSvpDeh5QwqM+VEFDy0LbgNMhMbldrvz9/ nrQZfg18qtgkaedB0C3uq01BXuek+oPeP9Ihcg38fG8XXy28o6JlCo19aRnOeEBT54ok aCMntKAn+JAanFeuhG+ZRfN9sChC64FeibLzNEtXb8FToQzI0Cj2Mf9Tm4JI4zoNRQeb TBVw== X-Gm-Message-State: AN3rC/43t4tdZ60Di6MY8IIvUVSIkRePyF6V58UgXYlTbPLT/5+Yizla NvS3etnSDkXLePFw3O6emYhFtFVTyc94 X-Received: by 10.36.65.81 with SMTP id x78mr415918ita.16.1492640810218; Wed, 19 Apr 2017 15:26:50 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Greg Woolsey Date: Wed, 19 Apr 2017 22:26:39 +0000 Message-ID: Subject: Re: Evaluating Arbitrary Formula To: POI Users List Content-Type: multipart/alternative; boundary=001a11c14b58453c5d054d8c85bc archived-at: Wed, 19 Apr 2017 22:26:58 -0000 --001a11c14b58453c5d054d8c85bc Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The class is org.apache.poi.ss.formula.ConditionalFormattingEvaluator in poi-3.16.jar. Use is something like this: WorkbookEvaluatorProvider wbEvalProv =3D (WorkbookEvaluatorProvider) workbook.getCreationHelper().createFormulaEvaluator(); ConditionalFormattingEvaluator cfEval =3D new ConditionalFormattingEvaluator(workbook, wbEvalProv); // if cell values have changed, clear cached format results cfEvaluator.clearAllCachedValues(); List rules =3D cfEvaluator.getConditionalFormattingForCell(cell); // check rules list for null, do what you want with results // EvaluationConditionalFormatRule provides a more user-friendly API to the disparate underlying elements for a given match On Wed, Apr 19, 2017 at 2:28 PM Blake Watson wrote= : > Greg, > =E2=80=8B > =E2=80=8BI'm having trouble figuring out how to use the conditional stuff= . =E2=80=8BI can't > seem to =3Dfind=3D ConditionalFormattingEvaluator in the POI jar. > > If I could find it, I'm not sure how I'd use it: > > ec =3D ConditionalFormattingEvaluator(Workbook wb, WorkbookEvaluatorProvi= der > provider); > > How do I create "provider"? I don't get the "IStabilityClass" thing. > > Once having it, I would guess I call: > > list =3D ec.getConditionalFormattingForCell(someCell); > > and for each item in the list: > > fmt =3D item.getFormatting(); > > But does getConditionalFormattingForCell return all the formats POSSIBLE = or > only the ones that apply based on the spreadsheet's current state? And if > the former, how do I eliminate the ones that apply? > > I feel like I'm looking completely in the wrong direction, but I haven't > been able to locate any examples of how to use this. > --001a11c14b58453c5d054d8c85bc--