Jump to content

conditional formatting in layout FM7


elwood00
 Share

This topic is 5696 days old. Please don't post here. Open a new topic instead.

Recommended Posts

OK - I have finally figured out how to assign different colors to a value (e.g. <60 red, 60 orange, >60 green) using a calculated field and a case statement .... however in my layout, the color gets overwritten by the color used for the field - when i click on the field it changes to the correct color, but when i just look at it - it does not..... how can i tell the layout to use the color assigned to the field??

Link to comment
Share on other sites

I don't think we have enough information. If I'm understanding you correctly, I not able to recreate what you are seeing. Either post a copy of your file, or at the very minimum, a copy of your actual calculation.

Lee

Link to comment
Share on other sites

sorry - did not post the calculation, since it seems to be working just fine. As I said, the field shows the correct color in the database, but not in the layout. E.g. When I am in my layout the text appears grey, when I click on the field to edit it, the text changes to red (which is the correct color based on the calculation). However, I want to always show the color based on the calculation, not the color that the layout assigns to the field. I am sort lookinf for something like in Word/Excel where i can select a text color DEFAULT.

But just in case, here is the calculation:

Case (

visits = 0 ; TextColor ( DayOfYear ( Get(CurrentDate) )-DayOfYear (Get(CurrentDate)-99 ); RGB (255;0;0));

number of visits per season=4 and DayOfYear ( Get(CurrentDate) )-DayOfYear ( last seen ) >60; TextColor ( DayOfYear ( Get(CurrentDate) )-DayOfYear ( last seen ); RGB (0;255;0));

TextColor ( DayOfYear ( Get(CurrentDate) )-DayOfYear ( last seen ); RGB (0;100;0 ) ) )

Link to comment
Share on other sites

I didn't request the calculation to see if it was working, or not. I requested it in liew of a copy of your file, in order to see if I could figure out what you are asking. Sorry, but it didn't help. So, I'm still stumped.

However, are you by chance talking about Layout MODE?

If so, are you saying that the color of the text in Layout Mode is not the same as Browse Mode?

If so, that is the way it is suppose to work. Why would you want it any different?

HTH

Lee

Link to comment
Share on other sites

No, not in layout mode - in browse mode.

I have a field where the text according to the calculation should be RED. If I look at it in my layout it appears in BLACK. When I enter that field in browse mode, it turns RED (showing me that the underlying calculation seems to work). However, when I tab out of it, or click on another field, it turns black again. So I assume the formatting of layout overwrites my calculations. How can I remove the text color that the layout assigns to the field?

I tried to add it as a new field to the layout, but even then it already has the color black assigned to it.

I attached a sample - the white 55 should be green (and it is when you click into the fied), the -266 should be red (ditto)

sample.zip

Edited by Guest
Link to comment
Share on other sites

In vs. 7, numbers can't be formatted in color. Change the calculation to type text. :wink2:

I can't understand why you are using DayOfYear() instead of just using days ... DayOfYear() will break when you cross the year boundary.

Edited by Guest
Link to comment
Share on other sites

You have a field defined with the word not (days not seen). I'm surprised it accepted it at all. And I'm unsure what that first line represents. If you want it to display -99 if there are no visits, then you don't need to evaluate at all. You might consider something like this:

[color:blue]

Let (

visitDaysAgo = Get ( CurrentDate ) - lastseen ;

Case (

not visits ; TextColor ( -99 ; RGB ( 255 ; 0 ; 0 ) ) ;

number of cuts per season=4 and visitDaysAgo > 60 ; TextColor ( visitDaysAgo ; RGB ( 0 ; 255 ; 0 ) );

TextColor ( visitDaysAgo ; RGB ( 0 ; 100 ; 0 ) )

)

)

... I corrected it in my calc so you'll have to fix the field or you'll get warning that it can't be used in calcs; well, you can but ALL your field names have spaces and many have function names, keywords or parameters in their names and it will cause you grief. If -99 isn't what you want if there are no visits, let me know what you want as a result and we'll tweak it for you. :wink2:

Actually, the last default color isn't needed (I don't think). You can format your field to display that color by default. Then the default result would be simply: visitDaysAgo. But there may be more to the calc than I'm spotting. I'm having a bit of trouble grasping what you want.

LaRetta

Link to comment
Share on other sites

Something is wrong here. If I only change the calculation to text, it works. But it works regardless if I create a new vs. 7 file. Have you ran the 7.0v3 Updater? There were font-formatting differences between versions.

Link to comment
Share on other sites

Hey Lee, I misspoke. Vs. 7.0v3 can colorize numbers. :wink2:

I wish I would have kept track of all the unexpected behaviors through 7 but, since the file 'repairs itself' when changed to text, I suspect it was not created with 7.0v3. Either that or it wonked out because of the fields names. I'm still surprised FM didn't produce warning messages. It won't produce warning on my 7.0v3 either until I re-modify the calc and attempt to leave.

Also, Elwood00, you can check the calculation checkbox 'Do not evaluate if all referenced fields are empty' because the calculation references two fields.

Edited by Guest
Added sentence
Link to comment
Share on other sites

Yes! I was running through all the changes in font colorizing in 7 but missed the obvious!

That field is formatted as decimal but nothing is checked on it. Change the number format back to General or Leave as Entered and it works even as number. :wink2:

I've read (from The Shadow) that in 8.5, even numbers with field-level formatting applied can now colorize ...

Edited by Guest
Link to comment
Share on other sites

This topic is 5696 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.