My.ADVISOR.com Sign-In
Username
Password
Sign Up 
Go to Article
Advanced Search 

FILEMAKER PRO 9

Conditionally Format Layout Objects in FileMaker Pro 9

Create better layouts and help users navigate your solutions by putting the conditional formatting feature to work.

 Subscribers: Sign-in to activate download link -- Example file showing how to use conditional formatting.
By Paul T. Mitchell, Soliant Consulting technical lead

UNLOCKED -- This article is provided to subscribers of FILEMAKER ADVISOR or DATABASED ADVISOR or FILEMAKER ADVISOR. To subscribe or renew, go to Advisor Store.

Conditional formatting tops the list of cool new features in FileMaker Pro 9. For years, I've wished we could vary the color, font size, and appearance of layout objects. I've done all sorts of tricks and workarounds to highlight selected portal rows, gray out buttons, or make different values appear in different colors. It's all now so much easier.


Figure 1: It's hard to tell what's missing -- A column of text values all with the same font size. Some fit in the space, others don't.



Figure 2: Much better -- A column of text values, with varying font sizes. Now they all fit in the available column.


Figure 3: Conditional Formatting dialog -- Notice the user has control over the order of the test conditions.


Figure 4: Text Format dialog -- Click on the "More formatting" button in the Conditional Formatting dialog to get here. This example only specifies the font size, but the font itself, as well as the style, text color, and fill color are all options.


Figure 5: Pre-set conditional value tests -- You can use these formulas instead of writing your own calculations.

To give you some ideas, here are a few possible uses for conditional formatting:

  • Gray out unavailable buttons or tabs
  • Highlight the current sorted column
  • Highlight empty fields
  • Gray out inactive records
  • Highlight the selected portal row
  • Display field labels in the field space
  • Reduce font size on longer text strings to fit fixed-length fields
  • Expand text size with window size (combine with the Autoresize feature)
  • Highlight fields for data entry based on user account.

To follow along with the examples I describe in this article, subscribers may download the example file.

Control font size

Here's a simple example: In a list of records, some text values are of greater length than others. Before conditional formatting, you had to stretch the field to be long enough to accommodate the longest likely value, otherwise the longer values would get truncated. This feature is even more important with numeric or date values, which appear as a question mark when they don't fit entirely in the field (figure 1).

But by using conditional formatting, you can vary the font size so longer text values fit better into the space available (figure 2).

You set multiple conditions in Layout mode, using the Format > Conditional Formatting menu item (figure 3). The object appears with the formatting associated with all the qualifying conditions, unless multiple conditions set the same attribute (i.e., color), in which case the last qualifying condition wins. (This is in contrast to the Case statement and other logical functions, which stop evaluating after matching the first true test.)

In this example, the condition tests for the text length of the value in the field. The first condition tests for values greater than 12 characters long. Such values will appear in 10-point font (figure 4).

The second condition tests for values greater than 15 characters in length and displays them as 9 point. The third condition tests for values greater than 18 characters long and displays them at 8 point.

Again, a value that is 20 characters long satisfies all three conditions. FileMaker Pro evaluates the conditions in the order in which they display, and uses the formatting associated with the last qualifying condition. For this reason, you can rearrange the order of the conditions by clicking on the double-headed arrow and dragging them up or down.

TIP: Notice in the example I used the new "Self" function (rather than the field name). This function lets me copy and paste formulas, or even, better yet, use Custom Functions to centralize my conditional formulas.

It isn't necessary to write your own formulas, either. A variety of hard-coded formulas are available in a drop-down menu. Some are more appropriate to text fields, others to number or date fields (figure 5).

Conditionally Format Layout Objects in FileMaker Pro 9

No reader comments ... yet.

    What do YOU think about this topic? Share your advice and thoughts using this form.

    Your Name

    REQUIRED : PUBLIC

    Your E-Mail

    REQUIRED : PRIVATE

    Job, Company

    OPTIONAL : PUBLIC

    City, State, Country

    OPTIONAL : PUBLIC

    Your Web Site

    OPTIONAL : PUBLIC

    Your Comment

    Please help everyone by keeping your comments on-topic, using clean language, and not defaming or making personal attacks.


    Your e-mail address is required, but it will not be displayed to the public or given to anyone. See our Privacy Policy. Comments become visible after they pass our spam filter, and spammers and abusers are permanently blocked. Please report spam or abuse.

    Paul Mitchell has eight years of experience working with FileMaker Pro, including nearly four years with the FileMaker, Inc., Technical Support team and almost four years as an in-house developer for a printer of retail signage. Before FileMaker Pro, he served in the U.S. Air Force, and held jobs in a variety of industries. Today, he's a technical manager at Soliant Consulting.

    Printer-friendly
    page layout

    Keyword Tags: FileMaker, FileMaker Development, FileMaker FileMaker Pro

    ADVISORAMA
    You must be a believer before you can become an achiever.

    ARTICLE INFO

    FileMaker Advisor

    Web Edition: 2008 Week 11, Doc #19430

    Print Edition: April/May 2008, Page 18

    SUBSCRIBER ONLY ARTICLE LOCKED


    File: Example file showing how to use conditional formatting.
    Subscribers, log-in for Download link.

    Subscribe to FileMaker Advisor Magazine

    Read the advanced guide to creating custom business database solutions with FileMaker software. Subscribe now to gain access to all the archives and downloads.

    FileMaker.Advisor.com

    Subscribe to Advisor Basics of FileMaker Pro

    Learn the fundamentals of using FileMaker Pro software. Every issue gives you step-by-step instructions on creating the databases you need. Subscribe now!

    FileMaker.AdvisorBasics.com

    Secrets Of The Top Experts -- Now!

    See exactly how to do it, step-by-step, in Advisor Academy CDs created by the top experts. Click to see what you can learn right now.

    AdvisorAcademy.com

    Free E-Newsletters

    Keep up! Hot News, How-To, Tips & Tricks, Expert Advice, and more. Click to request your's free.

    AdvisorUpdate.info

    Need Know-How Now?

    What direction are you going with your business? Advisor Guides are packed with the answers you need to work smarter. Can you afford to fall behind?

    AdvisorStore.com

    Showcase Your Smarts

    Submit your tips, techniques and advice and let Advisor promote your business and build your career. Show the world what you know!

    AdvisorTips.com

    Use of this or any other site, content, product or service of Advisor Media constitutes acceptance of Terms of Use.
    Portions copyright ©1983-2008 Advisor Media, Inc. All Rights Reserved.
    Reuse or reproduction of any portion or quantity of Advisor Media's copyrighted content, in any form, for any purpose, requires written permission.
    ADVISOR®, the ADVISOR logo, and other names and logos that incorporate ADVISOR are registered trademarks, trademarks or service marks of Advisor Media, Inc. in the United States and/or other countries.
    Other trademarks are used for identification, editorial or descriptive purposes and are the property of their owners.
    mitcp009 posted 03/10/2008 modified 05/12/2008 03:44:55 AM ztfmfd/ztfmfd
    domino-144.advisor.com my.advisor.com 05/16/2008 02:50:01 PM