SSRS Expression will not affect chart title visibility - reporting-services

I'm trying to use an expression in the visibility tab of the Chart title properties window to hide the chart title based on a Boolean parameter. parameter will hide other parts of the chart, but will not hide the chart title.
I've tried using both switches, and IIF statements to verify that my code was working in other parts of the chart. I can hide the body, legend, and even the entire chart. Nothing I do will affect the chart title, however.
=IIF(Parameters!Visible.Value = FALSE, FALSE, TRUE)
The chart title should no longer be visible, but instead remains visible and unaffected.
One work-around that I've used is to simply delete the chart title, and use a text box instead, which does react to the parameter's value, but I'm really wondering why I can't seem to get the chart title to hide based on the expression.

You thought you were angry before - this seems to be yet another bug that will probably never be fixed.
The Chart Title Visibility works, if you also use a Boolean True or the same function for the Caption (the text display in the title). Ugh.
This Caption makes the Title invisible.
Maybe you can make this lameness work for you though - have the caption property be the title if visible or True if not:
=IIF(Parameters!Visible.Value = FALSE, "Caption Title", CBool(1))
Since every bug that I've cared about is Closed as Won't Fix or WAD, I wouldn't bother submitting this one to Microsoft. I know - it's so disappointing.

Related

MS-ACCESS Conditional Formatting while scrolling

I have a continuous subform (Data) within a single form (Main) where I use conditional formatting. The problem is, when I click the scroll bar to go down the list, the conditional formatting is removed until I un-click the scroll bar. Scrolling through the list with the mouse wheel works perfectly.
I suspect this is due to a refreshing or repainting of the formatting that is inherently triggered by a click?
I tried using Application.Echo False, and Me.Repaint = False, with no luck (although I am not even sure where I would need to put these).
Does anyone have any experience with this? Note, the data displayed via subform Data is static, meaning the user cannot update the fields within this particular subform (not sure if that simplifies anything).
On a continuous form, conditional formatting is only performed on records that are within view. As new records are scrolled into view, there is a brief delay while the conditional formatting is calculated. As records are scrolled out of view, their conditional formatting is discarded. You should find that scrolling with the mouse wheel does have a bit of a delay in the conditional formatting.
In some situations, one solution is to build the conditional formatting into the recordsource. For example, suppose negative values for Balance should be shown with a yellow background, and you would like to be able to scroll quickly through all the records looking for yellow ones.
I do this by adding another field to the recordsource:
IIf([Balance] < 0, String(30,ChrW(9608)), "") AS BalanceBG
and then binding this to a TextBox with text color of yellow and font of Courier.
The 9608 character is a solid block, and a string of them fit tightly together to make a solid bar.
With this TextBox positioned behind the TextBox for [Balance], the yellow background will show even as the scrollbar thumb is dragged up and down.

SSRS Color Expression Not Working When Deployed

In SSRS 2016 I have a matrix that is using a recursive parent hierarchy and have the following expression outside of the column groups, this textbox is the referenced for the Color property to set the text White or Black:
=IIF(Level() = 0 And Fields!HasChildren.Value, "White", "Black")
This works perfectly fine using the preview in SQL Server Data Tools but when viewing the deployed report in report manager when this expression is true the row group text box has black text and not white, yet the column group text boxes have white text as expected.
If I export the report into Excel, Word, PDF, MHTML when the expression is true all text is white. This appears to a problem with the ReportViewer and it is the same in IE11 and Chrome 68.0.3440.84
Putting the expression directly on the textbox does not fix the issue, I have found that if I put the actual expression within the same textbox as a placeholder the property is set correctly.
Any suggestions on how to resolve this?
Expected:
Actual:
I had this problem too. Not sure if I can nail it down specifically, but what I did was looked at the canGrow and canShrink properties of every cell on the row, and make sure they are all the set the same way. In my case, both were set to true. Once I did that, the coloring rendered correctly on screen in SSRS.
Looked here because I had a very different problem that I was banging my head against the wall for where the problem wound up being settings for this field being different for cells in the same row.
I found the expression based foreground colour property doesn't propagate past the first column to any cell that has canGrow false. canShrink has no effect. Other cell properties don't show this problem.
Thanks liver.larson.
I believe this patch from Microsoft fixes the problem properly:
[https://support.microsoft.com/en-au/help/4338240/kb4338240-fix-toggle-item-font-color-and-background-color-expressions][1]
If your organisation won't let you deploy this patch, a workaround is to make the cell contents into an HTML placeholder, then use <font> and <b> etc. tags (possibly generated conditionally) to control the formatting of the cell. If the cell has numerical information in it, change the text box format to General and use the format() function in the cell's value expression to convert the value to text (the format string can be whatever it was in the Properties window for the cell)

How would you dynamically hide or display a SSRS header based on a parameter?

I need to hide or display the header of a SSRS report based on the value of a parameter. The parameter is called "Show Header?", and the values of this parameter are true and false. Is there a hide property for headers? If so, I'm not able to find it.
I'm not sure if you are talking about the table Headers or the report header (some people seem to use the term interchangeably).
I'm still self learning SSRS so there may be better options out there but a quick test i found the following.
For a Boolean Parameter type:
I used the logic below to hide the visibility based on parameter (you may want to play around with the true/false order depending on your parameter to get it to work how you want):
=IIF(Parameters!ShowHeader.Value, False,True)
Table Headers:
Just highlight the text boxes you want to show/hide and open up the properties, under Visibility select "Show or Hide Based on Expression"
(NB. i found highlighting the full row would only let you select the full tablix properties not the single row so I just shift clicked all the cells and pasted the IIF statement into the "Hidden" Property for the selection in the properties window)
Report Headers:
I am not sure you can hide the Header (couldn't see any immediate hiding properties or options), however you could hide the contents of the header using the same sort of process (right click properties and alter the Visibility setting or add the code into the Hidden property). In testing I found that the header would reduce to remove white space when items where hidden so may work out for you.
The sneaky way I've found to get around the limitation of SSRS on this is to put my "header" in the first row of the first tablix and just hiding the actual report header, which you probably know cannot be deleted. That way, I can show or hide the first row of the tablix by whatever criteria I desire. This method works well for me.

Hiding Textbox in SSRS and freeing up space

I am designing a report using SSRS 2008 R2 where there can be 2-3 sub headers. Now the headers are passed as parameters showing different options such as date range etc.Now I have used three TextBoxes for the three headers but the problem is if I pass 2 headers and even if the third TextBox is hidden it takes up space. I would have used a tablix had the headers appeared in a body section but It seems I cannot use a tablix in the header section.
I hope I was able to make myself clear. Does anyone have any answers regarding this.
Thanks.
If I may make a suggestion, that I've used before, use placeholders. So, what you do is go into the box that is right before the optional text box. Then, right click. You should see an option at the bottom for Create Placeholder. Click that and it will ask you to create an expression. Do an IIF check on your variable.
Example: IIF(MyVar = 1, vbcrlf + "My Header", "")
What this will do is check to see if MyVar = 1. If it does, then it appends onto your text box a new line with the text "My Header". Otherwise, it will take up no space.
Please let me know if this helps and good luck with your project.
You have to 'play' with 3 properties of your TextBoxes.
CanGrow: True
CanShrink: True
Hidden: =IIf(Parameters!YourParameter.Value = "", True, False)
To save space, you can also set a minimum Height for your TextBoxes and put them attached to each other.
you have to change the visiblity:
1)select textbox
2)right click on text box.
3) go to Text Box Properties
4)visiblity tab>click on "fx" for expression and write following code.
use if condition:
=IIF(Cstr(Header.value))="",TRUE,FALSE)
i hope it will solve ur issue.

SSRS Hiding the textbox in a table cell causes the borders to disappear

I have a report with a table in it. And each table cell has borders around it.
The problem I'm experiencing is that if I hide the textbox in any of the cells, the borders also disappear.
I want the textbox to hide but still show the borders.
The textbox in question shows the visibility toggle icons (+/-) so I can't use an iif statement to change the textbox's value to be an empty string when I don't want to see anything in it.
You can place the textbox inside a rectangle.
***So , I was having this same issue:* **
The Problem:
I assume that you placed a border around your text box and decided to place the hide and toggle element to your text box. or your Rows are not stepped down. Two solutions, I think the first solution is what you are looking for:
Solution 1:
I Noticed that SRSS reporting also has this grouping feature by rows. So to hide the text in the textbox without losing borders is to create a step-down feature within the grouping. So basically you can assign hide text box property without disturbing the rows above the textbox. This may be a better solution.
Solution 2:
You must instead place the border attribute to your text box and place the hide and toggle function on the individual groups. So for you, you have to remove the hide + toggle feature on the textbox. Right click the group element in your "rows" or "columns" and assign your drilldown hide + toggle feature on the group elements. In other words: "group properties" not "text box properties"
I hope this re-solve your issue.
I ran into the same issue. I solved it by changing the text color to white (or whatever the background color of the textbox is). I was doing this inside a table, and couldn't find a way to insert a textbox inside of a rectangle as stated in the other answer...
I had similar problem and used similar approach like #Anony Mous, but instead of changing text color to background color I used expression to change text value =IIF(InScope("RowGroup") = "True", Fields!Textboxvalue.Value, "") - and it works as expected.
Problem with background color change is that, if user unintendely select the text and makes it active, it become visible.
Just select the Textbox in question, run F4 (to access to the properties chart at the right side of VS or SQL), select the HideDuplicates dropdown and Select the Data Set that you are using :)