hi
I need to have different background colour on a report field based on the value of the field. If 3 then red, if 2 then green etc. etc. I see there is a function to create a formula, but can any body tell me how to create this formula?
Thanks
Different Color on a report field........
Re: Different Color on a report field........
Not sure if it will work. Did you try to make 2 fields. One green and one red and only fill one and hide the one that is not filled?
Best regards
Martin
Best regards
Martin
Re: Different Color on a report field........
Martin is on the right track, as this is what I thought as well. ReportBuilder does not have any field attributes functions, so you would need to do a workaround, as Martin suggests. Here is what I would try to finish his thought:
>> Create, for example, 3 fields for your number input item (as your example describes), for an input item = 1, 2, or 3.
>> Each field would be assigned this same input item, each field having a different bkgrnd. color. Only 1 would be visible at a time -- as I describe below -- depending on the input item value.
If input item = 3, have the '3 field' visible; if 2 the '2 field', etc.
>> Now define a formula for each field and use the RB function NumberIFF() to 'filter' it, like the one in the attached Formula Editor dlg. image, which should return a 1 (that is, 'TRUE') if the input = 3. BTW, TD Help has details about this and other RB functions.
>> I did in a quick example and called that formula: INPUT_EQUALS_3(). I added an image of the formula editor for this formula.
>> Now for your '3 field' use the Properties... dlg. box to define a Conditional Display so the '3 field' is visible when the input item = 3. I've attached an image of what I mean.
>> Now do the same thing for other fields when the input = 2, = 1, etc. Each field a different bkgrnd. color. Note that you may want to slightly offset each field, so in RB designer mode you can access (click on) each to access it. You can also move fields during design to access each one.
When the report runs, by definition any of the other non-'3' fields should not be displayed. Kind of a kludgy workaound, I know, but this or something similar should work. (I did not code it into a complete sample.) Let us know your results, especially if you had to code in something differently.
>> Create, for example, 3 fields for your number input item (as your example describes), for an input item = 1, 2, or 3.
>> Each field would be assigned this same input item, each field having a different bkgrnd. color. Only 1 would be visible at a time -- as I describe below -- depending on the input item value.
If input item = 3, have the '3 field' visible; if 2 the '2 field', etc.
>> Now define a formula for each field and use the RB function NumberIFF() to 'filter' it, like the one in the attached Formula Editor dlg. image, which should return a 1 (that is, 'TRUE') if the input = 3. BTW, TD Help has details about this and other RB functions.
>> I did in a quick example and called that formula: INPUT_EQUALS_3(). I added an image of the formula editor for this formula.
>> Now for your '3 field' use the Properties... dlg. box to define a Conditional Display so the '3 field' is visible when the input item = 3. I've attached an image of what I mean.
>> Now do the same thing for other fields when the input = 2, = 1, etc. Each field a different bkgrnd. color. Note that you may want to slightly offset each field, so in RB designer mode you can access (click on) each to access it. You can also move fields during design to access each one.
When the report runs, by definition any of the other non-'3' fields should not be displayed. Kind of a kludgy workaound, I know, but this or something similar should work. (I did not code it into a complete sample.) Let us know your results, especially if you had to code in something differently.
You do not have the required permissions to view the files attached to this post.
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Re: Different Color on a report field........
hi both of you with an answer,
Thanks a lot
It works fine
Again Thanks
Thanks a lot
It works fine
Again Thanks
Re: Different Color on a report field........
Cool! I have a bit of doubt when I suggest something that I did not code completely into a test case, so I am glad to hear it works on the first try. Thanks for letting us know.It works fine
Jeff Luther @ PC Design
Palm Springs, California
Palm Springs, California
Who is online
Users browsing this forum: [Ccbot] and 2 guests