SSRS Row Visibility on Text click rather than Plus Minus sign - sql-server

I have my SSRS report working properly, row visibility displaying correctly etc. However I would like to display my row visibility by using text as the clickable object, rather than the [+] & [-] sign.
Is this a possibility within SSRS?

Yes, you can do this with a Parameter:
Create a HideRow Parameter, type Boolean, Hidden. Set the default of the HideRow Parameter to your desired Hidden value for the Row when the Report is first executed.
Set the row's Hidden value to =Parameters!HideRow.Value
On the properties of the textbox you want to to control the row visibility, set the Action to "Jump to Report". Set the Report name to your Report name. Set the HideRow parameter value to =Not(Parameters!HideRow.Value)
This hyperlink will reload the report with the opposite HideRow parameter value.

Related

SSRS - Show a rectangle based on selected parameter

I have a quick question?
I have a report that contains a "TicketNo" parameter. This is a dropdown list and contains 2 types of values (example below)
'82736 - Change Request'
'78382 - Report Request'
How can I make a rectangle visible depending on which type of ticket was created? (Report request or change request)
So if a change request was selected, the rectangle showing change data would appear, and vice versa?
Appreciate any help as always!
There is a Rectangle object type in the Report Item Toolbox.
There you can set the border Style property to Solid an then add an Expression to its BorderColor property.
Write the expression as a conditional statement, setting it to Black or white depending on your condition, using an IIF statement.
Use the visibility property of the rectangle
Goto Rectangle Properties
Select visibility
Choose 'Show or hide based on an expression'
Input expression '=Parameters!TicketNo.Value=82736' assuming ticketNo is integer
Rectangle will be hidden if the condition is true.

Hide or Unhide based on tablix in SSRS

I am supposed to show textbox based on Tablix. It will be appear on the page where the tablix exists. It stops showing when the report page doesn't exist on the page. How can I achieve it?
I am thinking of using reportItems but I don't know exactly how.
I have already one column in my tablix for using reportitem. Can I have two report items in the same tablix( that one I am not sure too)?
Am I clear in explaining my issue?
Rather than checking if the Tablix exists on a page, perhaps think about what data causes the Tablix to exist.
Say your Tablix is displaying data on dogs, but on one of your pages you don't have any valid dogs, so no Tablix. In this case you could check for this in the Hidden property of the Text Box:
=IIF(Count(Fields!DOG_ID.Value) = 0, True, False)
(For the opposite of this, a Tablix has a NoRowsMessage property you can set rather than needing an extra Text Box.)
Goto the properties of the text box and then goto Visibility. Select "Show or hide based on expression" and click on the [fx] button.
To show or hide depending if the Tablix returns any data or not:
Then enter the below: =iif(CountRows("NameOfTheDataseOfTheTablix") < 1,True, False)

Using where clause in SSRS expression

I have a data set with multiple rows. The columns are name and plot; plot is a binary image file. If I want to display the plot whose name is secondPlot, for example, how would I do this? I can display just the first plot with =First(Fields!plot.Value, "DataSet1") but haven't had any luck with retrieving a plot with a certain name value.
I found if IIf function but am unsure on its usage or whether it's actually what I'm looking for anyway. =First(IIF(Fields!name.Value = "secondPlot", Fields.plot.Value, Nothing)) gives the error "The definition of the report '/MainReport' is invalid", for example.
For clarification, I'm typing this in Insert>Image>Database source.
Add a tablix component to your report, then assign your dataset to your tablix in the DataSetName property.
Delete columns and rows leaving only a textbox. Right click in the tablix and select Tablix properties... go to filter tab and add a new filter.
For Expression select Name, operator = and value use ="secondPlot".
The tablix will filter the row that contain secondPlot name and you can show the image in the tablix textbox by configuring background image property in the Fill tab.
Right click the textbox and select Textbox properties / Fill tab, in background image pane use settings like this.
UPDATE:
If your image is PNG, BMP, JPEG, GIF or X-PNG you can select the proper MIME Type.
Also if your image is encoded in Base64 you can try:
=System.Convert.FromBase64String(Fields!Plot.Value)
In the Use this field: expression.
Don't use any expression for the textbox. Just use the image field as textbox background.
Let me know if you need further help.

Show either chart or table based on radio button or checkbox in ssrs

I have a report request to show either chart or table using SSRS. I am mew to SSRS so not sure of woraround to make this work.
So far I tried below:
1. Create a "ShowDetails" parameter with
Data type - Boolean
Parameter Visibility - True
Available values - none
Default Values (non queried)- =False
2 In the chart properties set the Hidden to -> =Not(Parameters!ShowDetails.Value)
and toggle to textbox1 which I created for expand and collapse option.
Problem is radio button is not working ie., when I change the option to true no action on chart.Have to control the chart only by expand and collapse option.
Looking for other solution to show either chart or table based on show or hide parameter.
Thank You
Shilpa
I would write the expression in the Hidden Property of the chart like this instead.
=IIF(Parameters!ShowDetails.Value="False",True,False)
The above expression with some work around got me the answer. Below are the steps
Create a "ShowDetails" parameter with Data type - Boolean,Parameter Visibility - True Available values - Label-No, Value -True and Label-Yes, Value -False Default Values (non queried)- =True
2 In the chart properties set the visibility->Hidden -> =IIF(Parameters!ShowChart.Value="1",True,False)
With the above solution am able to hide and show the chart based on input parameter.
Thank You
Shilpa

Reporting Services 2008 Visibility

Using reporting services and trying to hide a field placeholder value when it does not equal "View" The value is hyperlinked to a subreport and is located in a bordered textbox inside a tablix. If I use the visibility feature for the text box, I can hide the non-view hyperlinks with an expression, but it hides the entire textbox and the textbox borders go away for that cell--I really want them to remain and just show the empty cell. If, instead, I try to hide the value on the placeholder level, which does not present the visibility option, and I attempt to evaluate the expression for the placeholder value to Nothing or '' when it is not valued as "View" then I get a hyperlink dash display in the column where I think it's attempting to render an unvalued hyperlink, which I really don't want. I just want an empty, bordered textbox.
Any way around this?
One solution is to change the visibility of the textbox value like this
IIF(fields(View.value) = 'true' , fields(TextBoxVariable.value), " ")
note that " " at the end will hide your dash
Or you can put a rectangle in the tablix cell and set its border, the you can put a textbox inside of the rectangle and change the visibilityof the textbox easily
put you link action on placeholder properties: Action - go to subreport, then put hidden expression on textbox: IIF(Fields!NameFields="View", true, false)
it works for me.
I know this is an old post, but I recently ran into this same issue.
Remove the expression from the text box properties and add it to the expression box of the field (right-click on the field and instead of choosing Text Box Properties>Visibility, choose Expression from the context menu). This will replace the field with an expression and the border lines will still exist.
Here's what I added to my expression:
=IIF(FORMAT(CDATE(Fields!ApprovedDate.Value),"dd-mm-yyyy") > "01-01-1980",Fields!ApprovedDate.Value," ")
I think that the easiest way to get rid off this hyperlink dash, is to change the font effect of the text-box. Just select Font-tab from text-box properties and from there, click fx-button of Effects and put somethin like this as expression:
=IIF(Fields!YourValueField.Value is nothing, "None", "Underline")

Resources