4 Replies Latest reply on Mar 24, 2011 2:12 PM by philmodjunk

    Conditional formatting text color does not work if I have specified a color within text field

    thomasseidler

      Summary

      Conditional formatting text color does not work if I have specified a color within text field

      Product

      FileMaker Pro

      Version

      11v02

      Operating system version

      Mac OS 10.5.7

      Description of the issue

      If I TextColor a text field or all of it, it will then ignore conditional formatting color change requests.

      Steps to reproduce the problem

      Obvious.

      Expected result

      Conditional formatting, being the last layer to be applied overrides the TextColor value within field...  but perhaps this is deliberately NOT the case? What is the reasoning? It is rather inconvenient...

      Actual result

      Conditional formatting of text color is disregarded

      Workaround

      pain

        • 1. Re: Conditional formatting text color does not work if I have specified a color within text field
          philmodjunk

          Any formatting applied at the layout level will be superseded by formatting applied at the data level. If you manually select text during data entry and apply a style, font, or color--just to name 3 possible examples, formatting at the layout level will not supersede these settings.

          You can define an auto-enter calculation that uses textFormatRemove to strip away all such formatting during data entry. You can also define a calculation field as TextFormatRemove(data field) and then place it on your layout in place of data field in order for your conditional formatting to work.

          • 2. Re: Conditional formatting text color does not work if I have specified a color within text field
            thomasseidler

            thanks Phil, i had a sneaking suspicion it might be *intended* behaviour. Got may way round this particular problem in another manner...

            • 3. Re: Conditional formatting text color does not work if I have specified a color within text field
              callmedave

              >>Any formatting applied at the layout level will be superseded by formatting applied at the data level.

              >>If you manually select text during data entry and apply a style, font, or color--just to name 3 possible

              >>examples, formatting at the layout level will not supersede these settings.

               I'm attempting to use a Conditional formula in a text block containing a merge field.

              My merge field is the number field //n_total_discount//

              My layout text block reads "Congratulations, your order qualified for <<n_total_discount>> in total savings"

              I  have formatted "<<n_total_discount>>" in the layout with a red text color; other text color is black.

              My conditional formula states //n_total_discount = 0//

              My conditional result is text color is white for the selected text block.

              With all text in the block the same color (no emphasis red), the conditional formatting works as expected; when there are no discounts there are no congratulations. But with the desired text color applied in the layout, the conditional behaves oddly, making "in total savings" red and the text to the left the desired white.

              Other tests with formatted text colors in text blocks gives different, but still undesired, results.

              I don't want to have to start mixing fields and text blocks, when having a single text block with the merge field is so elegant.

              Am I doing something wrong?

              (this is my first forum post; is it bad etiquette to piggy back my question onto Thomas' ?)

              • 4. Re: Conditional formatting text color does not work if I have specified a color within text field
                philmodjunk

                "piggy backing" like this is a judgment call. It's not as big a deal if this were a post in The FM PRO section as that is a general discussion forum for learning how to better use FileMaker. This section, report an issue, is intended for posting possible bug reports in order to notify Filemaker Inc. so that they can add them to their database of bugs if someone else has not previously reported the issue.

                In either case, it can sometimes make it easier to describe your issue as you don't have to start from scratch, but it can also "side track" a discussion in a completely new direction. Be aware, also, that older posts like this don't automatically pop up in the Recent list when a new response is added so they are more likely to be missed by other posters. If it's more than 2 months old, you may want to start a new thread, you can always paste a link to an older thread if you think it's applicable to your question.

                Now for your question. I think you've encountered a limitation of how conditional formatting works. My tests replicate your results. If I make a portion of the text block a different color, that color supersedes the conditional formatting.

                There is a work around that is hinted at already in this thread. You can apply the color directly to the data rather than the merge text. You might, for example, format a calculation field with this expression:  TextColor ( YourFieldHere ; RGB ( 255 ; 0 ; 0 ) ) to turn the data in the field red, then refer to it in your merge text instead of the original field.