Hide Column based up Parameter Selected SSRS - reporting-services

I would like to set the visibility of columns based upon the value selected in a parameter.
The problem is I do not want a specific parameter to do this (i.e Hide column X True/False)
My report has several different "departments" who are only interested in certain columns.
What would be the syntax for example to hide the "Sales" column when the "Customer Care" parameter is set?

you can do these works step by step:
1- press right click of your mouse in your favorite column
2- select column visibility
3- from opened window select "Show or hide based on an expression" radio button
4- set an expression for hidden state. for example:
=IIF(Parameters!CustomerCare.Value <> "favorite value", true,false)

Related

Clear out dropdown value once another drodown value is changed in vba access?

I have three combo box controls(MFG, Code, and GrpID) in my VBA access form. Once the user selects an option from the first combo box (MFG), rest of combo boxes give me available options. But I need to do some validation i.e. what if the user decided to change the value of first combo box? The values of rest combo box should be cleared. All I need to do is once the first combo box is changed the second and third combo box need to be cleared out or at least set to focus on them so that users will realize that they can't use old values as first value is cleared in the first combo box. I added a code block 'AfterUpdate for first combo box as shown below:
Private Sub MFG_AfterUpdate()
Code.Value = " "
GrpID.Value = 0
End Sub
The problem after writing above code is: they don't get empty until they(Code and GrpID) get clicked. In other words, I need to click them to empty them every time I change the value of MFG. Can anyone direct me how do I clear them or at least focus them?
Set the combo to null to wipe any displayed value in them;
Me.Code = Null
Me.GrpID = Null
This assumes your combo controls are called the same as your field names.
Edit for clarity: Including the Me. makes sure your are changing the form control values. If your field names are the same as the controls then Access will change the underlying field values, and as you have discovered on your form these aren't reflected until you click in that fields bound control.

SSRS Report Builder 2012 - How to hide list based on field value?

I'm using Report Builder 2012 to create a report. I have inserted multiple text boxes and other controls inside a list box so that I can hide all the controls at once just by hiding the list box. I'm using a SQL Server stored procedure to fetch rows of data. I'm using below expression to hide/show the list box.
=iif(Fields!certificateType.Value = "CT", False, True)
It works fine but it only checks the first row of data. If certificateType field is "CT" in the first row of data, it shows the list box but it doesn't hide the list box back for the next row of data in which certificateType is not "CT". It seems like list box visibility only checks the first row of data and applies it for all the other rows as well. How can i check the visibility of list for all the data rows?
Okay, based on our chat I have updated this solution.
I mocked up some data that looks like this:
certificateType
---------------
AT
BT
CT
DT
ZT
I created a quick and dirty report with a list. In that, I added a rectangle with a textbox in it. I set the dataset for the list to the main dataset (DataSet1 in my case). I set the expression for the textbox to this:
=Fields!certificateType.Value
Image in design mode:
I clicked on the list, and in the Row Groups pane, I right-clicked the Details rows, and chose Group Properties. On the General section, I clicked Add to add a new group expression. Then I chose certificateType from the dropdown.
I moved to the Page Break section of the Group Properties dialog and ticked the Between each instance of a group check box. Click OK.
Now, the report will break for each instance of a certificate type that comes in the dataset. So, if you have ten different cert types in the data, you will get one page for each.
You can't see it in my image below, but there are 5 pages now.
Hope this helps!!

SSRS (SQL2014) - hide a chart when a multi-value parameter is selected

On one SSRS report, I have a parameter called "Machine". User can select one or several machines in the list.
When only one machine is selected, I want to show a chart.
When several machines are selected, the data shown on the chart makes no sense, so I want to hide the chart.
Do you know how can I detect that user select only one or several machines? Which expression could I use in the "visibility" parameter of the chart?
Thanks in advance.
In the visibility property of the chart, use the expression:
=(Parameters!ParameterName.Count > 1)
This will hide the chart when more than one value is selected.
On the visibility property of your table(right click on the whitespace of the table=> properties=> visibility) add this peice of code
=IIF(Parameters!ParameterName.Count = 1, false, true)
ParameterName being your multiple-value parameter

Hide or Display column based on group visibilty expression

Currently working on an SSRS report in which there is a parameter "Display by Order" set to false as default. Within the body of the report, I would like to set the group expression to display the Column order if Parameter "Display by Order" is true otherwise do not display the column. I am unsure what the expression would be for this. Help would be greatly appreciated.
Thanks
The Hidden expression for the Column Visibility should be something like:
=Not Parameters!DisplayByOrder.Value
This just flips the parameter value, i.e. if the user selects True, the Hidden property should be False.
More details as requested
Add a Boolean parameter called DisplayByOrder.
I created a simple table with two columns.
Set the Column Visibility for the second column by right-clicking the top of the column to bring up its properties, then using the above expression:
Now the column is hidden/shown by the parameter selection as required:
Hi try with something like this
IIf(Parameters!DisplayByOrder.Value = False, True, False)

SSRS validating parameters and stopping report

So I have two combo boxes, box1 and box2. The requirement from within SSRS is if box1 is selected set Box2 to None and if box2 is selected then set box1 to none. Now I don't think this is possible because you can only cascade parameters in one direction. Otherwise you get forward dependencies are not valid.
But the question becomes can I validate the boxes when they click View Report to display a msgbox saying Please either choose box1 or box 2 but not both
Note: I am still working in 2005.
As far as I know, View button code cannot be accessed. As a workaround, you can do the following:
Add a textbox in your report and let the text be something like "Please enter either cmb1 or cmb2" .
Now from the Database check if both Values are entered. If yes, just return the columns in your select statement as NULLs or specify a value e.g. EMP_NO = 9999.
In your report if the returned value for EMP_NO is 9999 by checking FIRST(fields!xx.value ) = 9999 you can determine what did the user enter.
Add an condition to the textbox visibility checking if the value is 9999 or not, do the same for other items in the report to hide them and just show the textbox.
This can be used for other validations as well.