SSRS Format and Extract Formula - reporting-services

I have a field in my SSRS report that has color name.
but sometimes it has 2 colors formatted like so
<font> color=red BLACK </font> / <font> color=black BLUE </font>
please note I removed the <> from the line above since it shows as HTML and I cant figure how to make it show as text in this site
what is needed, is an if statement..
that if the field has the format above.. it would display...
OLD color = Black / New color = Blue
if it doesn't have the format above it would just display the color name of the field.
any help would be great
photo of current and what is needed to show up

Related

Excel Formula for different font color in one cell

Can you provide a formula to display a single cell value as text with multiple colors in Excel, where half of the text is red and the remaining text is blue, as the value is given in a single cell and needs to be displayed in two colors within the same cell.enter image description here
Formula:
="ERRORS ("& COUNTIF(D17:D,"=Fail") &") & WARNINGS ("& COUNTIF(D17:D,"=Pass") &")"
Output
ERRORS (5) & WARNINGS (5)
enter image description here
The "multiple colors" concept you describe is called rich text. In Google Sheets, rich text cannot be produced with any spreadsheet formula. To programmatically put rich text in in a cell, you need a script. See RichTextValueBuilder.

Oracle APEX changing the colour of display only item with PL/SQL query

I have a display only item in a static content which looks like this:
I want to change the whole background colour of the button/item instead of the text's colour.
My PL/SQL code looks like this for example for the first item:
SELECT case ACTUAL_SITUATION when 'Y' then '<span style="color:green">Yes</span>'
when 'N' then '<span style="color:red">No</span>' end as "ACTUAL_SITUATION "
FROM tableName
Is it possible to change it with PL/SQL? All I could do is change the span background colour and that was just a highlight on the text.
Assuming you have a "Display Only" field, set the "Source" to be a "SQL Query(return single value)" and be sure to set under "Security", "Escape special characters" to "No" to allow the HTML to flow through. Note that you want to use background-color not color in your style to set the background.
I tested it and it works.

SSRS: Is there a Limit to what you can type in a TxtBox Property?

I'm using Visual Studio 2010.
In the Properties for a Text Box in my report I have an Expression like this:
=IIf(Fields!SubCategory.Value = "Value 1:", "Snow", IIF(Fields!SubCategory.Value = "Value 2:", "Snow", IIF(Fields!SubCategory.Value = "Value 3:", "Snow", "White")))
It is working fine but I need to add another IIF clause to include "Value 4:".
The values are not actually "Value 1:" ... etc - but longer descriptive names so the actual text in the Background Colour Property box is longer.
When I try to add the text, I am not able to do so. Is there a reason I cannot add the new IIF clause to the expression?
Sorry. I found out why I was not able to edit the expression in that particular Property field.
I erroneously gave the example of the Background Color property - when I should have pasted the example from the Font Weight property.
The problem was that I had not gone specifically to the 'Font Weight' property but was trying to edit text in the 'Font' category without dropping the arrow and expanding the Font properties.
Once I expanded the Font category, I was able to edit the Font Weight property.
Apologies!

How to have multiple colors on a jlabel when the text is constantly changing?

If this is the code to have multiple colors in html format in a jlabel
"<html><font color=red>Message</font> - <font color=navy>message</font></html>"
is there a way I can change the message? Im using this in a java app and when I try to change the message to the variable name it just gives errors.
Seem you read other topic about multiple color in a Label already.
So it is legel and work like
Lable.setText("<html>......</html>")
If you want it automatically change.
You have to add few different statements of Lable and make it run at background.

How do I substitute one entry for another an MS Access report?

I recently started working with MS Access 2010, and I am trying to generate labels from a form that I have created. In the form, three pieces of information are put in by the user: style, color code, and unit of measure (UoM). The style numbers appear the same way on the form and in the report, and I have been able to get that to work.
However, for the color code, I need both the inputted color code and the actual color to show up on the report. I have a table that has all of the color codes with the corresponding color names. I cannot figure out how to get the text box that is supposed to show the color name to show it. I know virtually no SQL, but I found information on it on the internet and pieced together this code in the ControlSource for the text box the color name is supposed to be in:
=(SELECT [Description]
FROM [Color]
WHERE([Forms]![Box Label Form]![ThirdJoined]=[Color]![ColorCode]))
[Description] is the name of the column within the [Color] table that gives the actual color name.
[Box Label Form] is the name of the form.
[ThirdJoined] is the name of the input text box within the form.
[ColorCode] is the name of the column within the [Color] table that gives that color code.
This code doesn't work, and only results in #NAME appearing in Print Preview view. How can I get this to work, either code-wise or otherwise?
You cannot set the ControlSource of a textbox to a SQL statement. You could set it to a DLOOKUP function to lookup a single value. You also need to separate out the reference to the form control using concatenation (&).
=DLOOKUP("Description","[Color]","ColorCode='"&[Forms]![Box Label Form]![ThirdJoined]&"'")
I'm assuming the Color is a text-value so the form-value needs to be enclosed in apostrophes.
If this expression is used on the form [Box Label Form] then you don't need to qualify the name of the Control:
=DLOOKUP("Description","[Color]","ColorCode='"&[ThirdJoined]&"'")