How to get one fields value with different colors based on another fields value in ssrs expression - reporting-services

I have to color one field based on the value of another field.
Here is an example:
Textbox 10 should display field A.
The color of the text in Textbox 10 is based on the value of field B.
I see how I can change the color of Textbox 10 based on the value of field A, but I do not know how to have the color set based on the value of another field.
What is the code that I need to put into the SSRS expression for textbox 10?

You can reference any field that's in scope or that can be reached from your current scope. Use something like this for the color property of Textbox 10:
=IIF(Fields!FieldB.Value > 5, "#FF0000", "#00FF00")

Enter the expression that references other fields, in the color property.

Related

Conditionally change field visibility depending a many2many in odoo 11

I try to change the visibility of a field depending if a element is selected in a many2many relation, but I cannot determine how to write the condition.
I can do this with a one2many, but doesn't work with a many2many.
For example I have a multi select field with: X Y and Z values, and I want that an another field become visible if Y is selected.
Do you have an example to provide me ?
Thank you !

Retrieving value including input mask from TextBox field - Access VBA 2016

I have an input mask of JAAA-AAA on a TextBox, so when the user enters that input field, they will see this: "J___-___".
However, when they fill it out like so, J123-321, and I get the value using [myfield].Value, it says that the value is only 123321. It strips the preset 'J' and '-' I had in there. How can I prevent the stripping of these characters when I retrieve the value from this field?
You need to set the second part of the input mask property to 0.
If you look at the documentation, you can see it has 3 parts, and the 2nd part controls if the mask is stored with the data, or only the data is stored.
The final mask property would be the following:
\JAAA\-AAA;0;_

SSRS parameter Default value not showing correctly on filter bar

When my month Parameter's Value and Label fields are not the same the default value assigned does not display correctly on the filter bar.
Available Values
When viewing the report the Month filter shows as in the image.
IncorrectFilterView
When I make both the Value and Label fields the same the Month filter shows as in this image.CorrectFilterView
The expression I use for the Default value is: =Format(DATEADD(DateInterval.Month,-1,Today),"MMM")
I have also tried: =DATEADD(DateInterval.Month,-1,Today)
I can continue bit both the Value and Label fields being set to MonthShort, but this makes getting the month number a mission in some of my calculations.
I'm also considering adding another hidden param just for the number.
Your default value should the the same type as the 'Value' field not the label field.
Just change the default expression to
=Format(DATEADD(DateInterval.Month,-1,Today),"MM")
this will give you 12 rather tyan 'Dec'. The parameter will show as 'Dec' in the dropdown list though as 'Dec' is the label for 12.
Remember, the parameters label property is primarily there for the user, the report always uses the Value field.
You may also want to consider chaning the sort order to the MonthNumber field too.

Value in Texbox1 have to search all other Textbox available in the Form and change backcolor

Could somebody provide with sample data on my requirement.
I have one main textbox with a date in the format: dd-mm-yyyy there is another 42 textboxes with date of format: dd.
I want to check if the value in main textbox matches any of the other 42 textboxes in form. If there is match found, I want the Backcolor of the matching textbox to change to Orange or Red in colour.

Highlighting a row once a parameter has been selected in SSRS

I have a report that has 3 parameters: RaceDate, RaceCourse, SilksColours. The SilksColours parameter is optional.
If the SilksColours parameter is selected I want to highlight the row in my report with the colour yellow, while all the other rows stay white.
Is this possible?
For each TextBox in the row you want to highlight, you need need to set the Background Color property to be expression-based and compare the parameter value to value in the row, something like:
=IIf(Fields!Colour.Value = Parameters!SilksColours.Value, "Yellow", "White")
Edit after comments:
OK, as you've noted there are two questions here.
Parameter with default
You have a requirement to have a multi-value parameter with the ability to specify no value in particular. You can't set up a multi-value to accept NULL values, so you need to add a catch all value to the DataSet. So base the parameter on values similar to the following:
Set a parameter up to use this DataSet and set the Default Value to None:
Now we have a parameter with a default, which will not highlight any rows, so users can just ignore if they want or choose values as required.
There is one minor annoyance here - the user can select None and other values as well, they aren't mutually exclusive, but it should be good enough.
Highlighting rows
Next step is to set the Background Color values for all required TextBoxes. Since multiple colours can be selected, we need to treat multi-value parameters differently from single ones, something like:
=IIf(InStr(Join(Parameters!Colour.Value, ","), Fields!Colour.Value) > 0
, "Yellow"
, "White")
So what we need to do is use the JOIN function to create a string list of selected values, then check if the row value is anywhere in that list. Put it all together to get the following:
The report will load straight away as the parameter has a default value, with no rows highlighted:
Choose one colour and the row is highlighted:
Choose multiple colours to highlight multiple rows:
Hopefully all this is what you're after!