I would like to get the background color specified in the previous row.
So instead of Previous(Fields!xxx.Value) something like Previous(Fields!xxx.Color).
I can't find any documentation of which options i can use instead of .Value.
Any suggestions?
What i want to achieve is change the background color of my row if a member changes, but the color i want to change it to should be dependant of the color of the previous row.
Thanks in advance.
Marc
There is no way I know to check the previous cells color unless you set it with custom code. Check out: SSRS: Get backgroundcolor from Cell
If you were only alternating colors you could do the following:
=IIF(Previous(Fields!FieldName.Value) = Fields!FieldName.Value, "Blue", "Red")
Depending on how many members you had and what colors you wanted you could always specify the colors based on the member with a default color.
=IIF(Fields!FieldName.Value = "SomeMember1", "Blue", "Red")
=IIF(Fields!FieldName.Value = "SomeMember2", "Blue", "Red")
=IIF(Fields!FieldName.Value = "SomeMember3", "Blue", "Red")
Related
Anyone have an idea how to get the background and line color from a custom hatch fill?
the following code fills the selected shape using data from textboxes
ActiveSelectionRange.ApplyCustomHatchFill ANG.value, LS.value, 0, 0, 0, LT.value, CreateRGBColor(255, 0, 0), BackColor:=CreateRGBColor(255, 255, 255)
this works fine I also have a color picker that changes the color of the line and background which is fine but if you change the line size the color changes back to what is specified in the code above
what I need to get is the current color of the line and backcolor in the selected shape so that I can change the line thickess while retaining the set color
i have a feeling its something to do with GET patternfill.backcolor but I cant find any examples on its usage
Any help is appreciated
mark
UPDATE
OK I have found the following gets the back colour into a string
value = s.Fill.Hatch.BackColor.ToString
I can then do a split and get the values
But there doesn't seem to be an option for getting the line colour (Forecolor)
Any Ideas?
Hatch Fill
A shape's hatch fill is a HatchFill object. It has one BackColor and one or multiple Patterns().
Each pattern has an Outline (specifying the line in the pattern) which has a Color which can be read by e. g. ToString or other methods to read a color.
If you want to change other properties of your hatch fill lines, please see all the properties and methods of an Outline here
Some examples:
s.Fill.Hatch.BackColor ' background color
s.Fill.Hatch.Patterns(1).Outline.Color ' line color of first pattern
s.Fill.Hatch.Patterns(1).Outline.Width ' line width of first pattern
You may also check, if it really has an opaque background: Fill.Hatch.HasBackground
Pattern Fill
Just in case: A pattern fill is simpler and has only two colors:
s.Fill.Pattern.FrontColor
s.Fill.Pattern.BackColor
Okay im trying to show the value of the clients report and indicate if the value is bad or good with color. But instead of showing the value in color it shows the name of the color like Green instead of 33%
=SWITCH(SUM(Fields!AnserValue.Value, "qWHR") <= 33, "Green",
SUM(Fields!AnserValue.Value, "qWHR") <= 66, "Orange",
SUM(Fields!AnserValue.Value, "qWHR") >= 65, "Red")
It looks like you are setting the value of the text box and not the background colour property?
Your switch expression doesn't look like it has any problems, just make sure you are setting the appropriate property of your text box and not just the text held within it.
I am loading a dataset into my report and filling my last column with this expression: =Sum(Fields!ID.Value) and it loads fine, I am trying to put a condition in so when the number is less than 15 for example, the cell color will change to red. I have tried so many different syntax but nothing works... it must be pretty simple...?
The errors I am getting are: The value expression for textbox has scope parameter that is invalid for aggregate
Any help would be good :)
To set the background color Click on the cell and in properties window on your right hand select the BackgroundColor property and then set expression to that property.
Or right click on cell and select TextboxProperties -> Fill and at the start there is option to set the expression for fill color.
You are using the wrong expression the expression should be ,
= IIF(Sum(Fields!ID.Value) < 15,"Red","Transparent")
You can change the Transparent to whatever color you want.Take a look here on how to use expressions.
This shows how you could add a colour range if necessary by using the Color property to set the font colour.
=iif(Sum(Fields!ID.Value) < 15,"Red",iif(Sum(Fields!ID.Value)>50,"Blue","Black"))
To Change the background colour instead you would use the Background colour property.
=iif(Sum(Fields!ID.Value) < 15,"Red", "No Color")
Note that SSRS 2008 "Transaparent" is replaced by "No Color". Whilst transaparent works it gives rise to this warning message.
[rsInvalidColor] The value of the BackgroundColor property for the textbox ‘textbox22’ is “Transparent”, which is not a valid BackgroundColor.
As an alternative to these use "#FFFFFF" instead of Transaparent or No Color
I have a custom coloured background that the user can choose, this however means when they change the colour, the label is invisible because it is the same as the background and I do not want this. The code I have is: opacityLabel.textColor = bgView.backgroundColor; In this bit of code the colour is the same at the start but doesn't change when I adjust the background colour, I also need the colour to continually change with the background colour, I was wondering what I could replace with "=" to make the label do the opposite colour. I can't do "!=" because that means is not equal to rather than opposite! If you can't do it this way could you provide me with a way of doing it?
The first thing you'll need to do is calculate the opposite colour to the backgroundColor, and then assign it to the textColor property.
To do this you'll need to use the getRed:green:blue:alpha: method on backgroundColor. This will give you values between 0.0 and 1.0 for each component of your colour.
Then use the UIColor class method colorWithRed:green:blue:alpha: to create a new UIColor, but use (1.0 - component value) for each of the components.
Then finally assign your new colour to opacityLabel.textColor
I have a list of colors i.e.: "1323523, 12342, 2354, 356234, 234234"
Each of these numbers stand for a color. I would like it so that when there is colordialog.showdialog, this list of colors shows up in the colordialog custom boxes.
this is how i am doing it currently, but for some reason the customcolors are not being added. i know for a fact that my array is good because i checked it.
Dim numberStrings = My.Settings.mytext1.Split(","c).Select(Function(x) x.Trim())
ColorDialog1.CustomColors = numberStrings.Select(Function(x) CInt(x)).ToArray()
Here is the documentation on the CustomColors property.
http://msdn.microsoft.com/en-us/library/system.windows.forms.colordialog.customcolors.aspx