Courtney Posted January 20, 2005 Posted January 20, 2005 Is it possible to apply conditional formatting to a layout in FM similar to excel, whereby alternating lines could be given different background colors for easier readability? (i.e., line 1 is gray, line 2 is white, line 3 is gray, line 4 is white)
stanley Posted January 20, 2005 Posted January 20, 2005 Courtney: You can do this within portals, which is one of the things that makes a portal so handy for showing lists of data. -Stanley
Courtney Posted January 20, 2005 Author Posted January 20, 2005 Thanks for the response. Is there a particular term that would help me narrow down my search for how this is done? ~Courtney
stanley Posted January 20, 2005 Posted January 20, 2005 Courtney: If you know how to create a portal, double-click on the portal in layout mode, and you will see the option to "alternate background with" and then a color box, where you can choose your alternating color. -Stanley
-Queue- Posted January 20, 2005 Posted January 20, 2005 You can also use a global container field with two repetitions and one color stored in each, and a calculated container field equal to GetRepetition( gContainer, not Mod( Status(CurrentRecordNumber), 2 ) + 1 ), which will return the first repetition for odd records and the second for even ones. Put this field in your body part and format it as desired, making sure to disable entry into it.
Courtney Posted January 21, 2005 Author Posted January 21, 2005 You can also use a global container field with two repetitions and one color stored in each Ok, got that set up, and named it gContainer. and a calculated container field equal to GetRepetition( gContainer, not Mod( Status(CurrentRecordNumber), 2 ) + 1 ), which will return the first repetition for odd records and the second for even ones. Put this field in your body part and format it as desired, making sure to disable entry into it. This makes sense to me, but I'm apparently doing something wrong, because I'm not getting anything in the calculated container field (which I named Background). I set up a layout to display each field separately, so I could maybe see what I was doing wrong, and my gContainer field displays the two colors horizontally as I set it to do, but the Background field does not display either one of the colors. Any clues to what I may be missing?
Courtney Posted January 21, 2005 Author Posted January 21, 2005 Digging a little deeper... when you say "calculated container field" should that be a calculation, where the result is a container? Or a container field with an "auto-entered" value equal to the calculation? (I have tried both, but I suspect the latter is more correct than former.) Or is it something else altogether?
Courtney Posted January 21, 2005 Author Posted January 21, 2005 Well I figured it out just by modifying the formula: If( Mod( Status(CurrentRecordNumber), 2 ) , GetRepetition( gContainer , 1 ) , GetRepetition( gContainer , 2 ) ) (Just posting in case anyone else is searching for a similar solution.) ~Courtney
-Queue- Posted January 21, 2005 Posted January 21, 2005 Sorry, that should have been GetRepetition( gContainer, (not Mod( Status(CurrentRecordNumber), 2 )) + 1 )
Courtney Posted January 21, 2005 Author Posted January 21, 2005 So now that I have my background color being generated properly, I'd like to generate two reports based on two different layouts (and sorted in two different ways). How can I make the background field update itself based on the sort (which changes the CurrentRecordNumber)? Relookup doesn't seem to be the answer. ~Courtney
-Queue- Posted January 21, 2005 Posted January 21, 2005 I'm not sure I understand the question. The current record number is dependent on how the items in the found set are sorted. It naturally updates for each sort order, as long as the calculation is unstored. Record number 1 in one sort order may be record number 4 in another. In the first case, the calculation will contain the first color; in the second, it will contain the other color.
Courtney Posted January 24, 2005 Author Posted January 24, 2005 I figured out my problem or at least a way around the problem. Although the record numbers were changing according to the sort, as is logical, the "background" wasn't "recalculating" based on the new value of the record number. (Even a relookup would only change some fields and not others - I'm not sure why.) So I'm writing a script to clear all values in the "background" field, and do a relookup each time the sort is performed. Preliminary testing looks like this will make it work as expected. Thanks for all your help. ~Courtney
-Queue- Posted January 24, 2005 Posted January 24, 2005 Did you make the container calculation a calculation field or a container with an auto-enter calculation? It should be an unstored calculation field with a container result.
Courtney Posted January 24, 2005 Author Posted January 24, 2005 That fixed it! Thanks so much. I had a container field with an auto-enter calculation.
Recommended Posts
This topic is 7244 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now