In a SSRS report my chart is linked to a dataset. However in the expression it says "Report item not linked to a dataset."
I like to hide the chart when no data is available. But because I cannot see the dataset it won't work. Even when I mention the dataset in the expression:
=IIf(Count(Fields!hostname.Value, "DataSetName")=0,True,False)
It gives me this error when I hover over "hostname.Value" => "Unknown collection member."
I've already remove the .data file because it was suggested here, but that doesn't work.
Anyone an idea?
You can set the charts visibility property by writing an expression using CountRows
= IIf (CountRows("dataset1") > 0, false, true)
or
= IIf (CountRows() > 0, false, true)
Or else go to the property window of the chart .You will see NoDataMessage expand it and in the caption mention
No data available
and set the property to false
Related
Hello all I am writing the following condition to hide the textbox based on a condition but some how it is not working
<Hidden>=IIF(Format(Fields!VisitDt.Value,"MM/dd/yyyy")>= Format("2022-01-08","MM/dd/yyyy"),True,False)</Hidden>
So what should be the correct way to do this can some one let me know
If VisitDt is actually a date field then you can do something like
=IIF(Fields!VisitDt.Value >= DATESERIAL(2022, 1, 8) , True, False)
You could actually simply if further as the Hidden property only requires an expression that evaluates to True or False so you could simply use
=Fields!VisitDt.Value >= DATESERIAL(2022, 1, 8)
There is no need for the IIF
I am trying to combine to iff statements for a textbox in the footer of my main report:
=IIF(not(ISNOTHING(First(Fields!psa_project_psa_legalentity.Value, "DSMain"))) And First(Fields!psa_project_psa_legalentity.Value, "DSMain") = "M&P Audit B.V.", False, True)
=IIF(globals!PageNumber = 1, False, True)
Separately they function perfectly fine however when I want to merge them for a visibility expression I get a error everytime I upload the report. These are the things I tried so far:
=IIF((not(ISNOTHING(First(Fields!leg_psa_name.Value, "DSMain"))) And First(Fields!leg_psa_name.Value, "DSMain") = "M&P Audit B.V.", False, True))
& IIF(globals!PageNumber = 1, False, True)
and
=IIF(not(ISNOTHING(First(Fields!leg_psa_name.Value, "DSMain"))) And First(Fields!leg_psa_name.Value, "DSMain") = "M&P Audit B.V.", False, True)
, IIF(globals!PageNumber = 1, False, True)
Does anybody have some advice for me how to do it?
Thanks in advance for your help :)
You need to nest your IIF statements in order to use both of them in the same expression box.
example expression: =IIF(IIF(condition1,trueCase1,falseCase1)condition2,trueCase2,falseCase2)
I'd like to make a text box (Text28 hereafter) and a combo box (combo43 hereafter) enabled when another combo box (Combo26) takes the value "Resolved"
So this is the code, written in VBA, that should do that :
Private Sub Combo26_AfterUpdate()
If Combo26.Value = "Resolved" Then
Me.Text28.Enabled = True
Me.Combo43.Enabled = True
Else
Me.Text28.Enabled = False
Me.Combo43.Enabled = False
End If
End Sub
Unfortunatly, nothing happens when I try it. Would you have a idea ?
Thx
If you are pulling two columns as your row source (as indicated in your comment above), it looks like the first one that is displayed is the ID. You should target the second column to do your comparison, e.g.,
If Combo26.Column(1) = "Resolved" Then
...
That works for me!
Combo26.Column(0)
will give you the ID.
SQL Server 2012 - SSRS Questions
I currently have a Pie chart that shows the number of deliveries as a percentage on whether they are late, on time or early. What I am trying to do is use an Expression in the Chart Series Labels "Visible" property to hide the label if it is 0 on the chat. Of note in the table this value is returned as 0.00 I have tried using various SWITCH and IFF Statements to do this but nothing seems to work and its likely I am getting the syntax wrong, can anyone help?
Table Values
TotalIssued Early Late OnTime EarlyPerc LatePerc OnTimePerc
6, 0, 4, 2, 0.00, 66.67, 33.33,
=SWITCH(
(First(Fields!EarlyPerc.Value, "EstimatesIssued") = 0),false,
(First(Fields!LatePerc.Value, "EstimatesIssued") = 0),false,
(First(Fields!OnTimePerc.Value, "EstimatesIssued") = 0),false,
true)
Thanks
Try:
=SWITCH(
First(Fields!EarlyPerc.Value, "EstimatesIssued") = 0,false,
First(Fields!LatePerc.Value, "EstimatesIssued") = 0,false,
First(Fields!OnTimePerc.Value, "EstimatesIssued") = 0,false,
true,true)
UPDATE:
If you have one field per percentage and your dataset returns one row always, you have to select each serie in the ChartData window and press F4 to see properties window.
In properties window set for EarlyPerc Visible property:
=IIF(Fields!EarlyPerc.Value=0,False,True)
And so on for the next two series you have (LatePerc and OnTimePerc).
Let me know if this helps.
I am trying to sum only the visible rows only in SSRS and I have read a few forums that say you need to put:
=Sum( iif( <The condition of Visibility.Hidden expression>, 0, Fields!A.Value))
However I am unsure on how this works, my visibility code is:
=iif(Fields!Sub.Value = "Ins", True, IIF(Fields!Sub.Value = "Ins - Int", True, False))
When I add this into the above 1st code i get #ERROR.
Appreciate any help.
Thanks
Try this:
=Sum(iif(
Fields!Sub.Value = "Ins",
0,
IIF(Fields!Sub.Value = "Ins - Int", 0, Fields!A.Value)
))
Note I am not using the same expression for hiding the rows, I am just using its logic.
Hopefully this is what you are looking for, let me know if you need further help.