Solved

SSRS expression errors

Posted on 2013-02-01
4
361 Views
Last Modified: 2013-02-27
I am trying to figure out how to hide or show a Row / textbox based on a SQL Query retruning a row of data or not. The expression is below:
=IIF(fields!TermsAndConditionsForPO.Value = "", True, False )

When I run the report True or false is displayed instead of either hidding or showing the  T&C conditions.

Also I am trying to place an "X" in a row if the data retruned is a "1" from the SQL query. The expression for that is below. The SQL query does retrun a 1 or 0.
 =IIF(Fields!UID.Value="1",IIF(Fields!UNITCOST.Value>=5000,"X",""),"")

Please help
Thank you
0
Comment
Question by:newjeep19
4 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 38844722
>When I run the report True or false is displayed instead of either hidding or showing the  T&C conditions.
Where do you have the expression?  It should be in the textbox's right-click:Properties, Visibility, select 'Show or hide based on an expression' radio button, hit the fx expression button, and paste it in there.
0
 
LVL 15

Expert Comment

by:santhimurthyd
ID: 38844762
you have to set the condition to the visibility propertie of the Textbox

=IIF(fields!TermsAndConditionsForPO.Value = "", True, False ) , but changing the visibility of an Text box in an Tabular report doesn't hide the row the of the Tabular report. to hide Row we need to set the condition to the row visibility property

In you condition

=IIF(Fields!UID.Value="1",IIF(Fields!UNITCOST.Value>=5000,"X",""),"")

In this record will go to true condition (IIF(Fields!UNITCOST.Value>=5000,"X","")) only when the UID value is 1 else will got the else condition and display empty "",

alos the True condition will display "X" only the value of UnitCost >= 5000.

Please verify your condition is valid.
0
 

Author Comment

by:newjeep19
ID: 38845228
I changed my expression to: =IIF(Fields!UID.Value="1","X","")
However, when I run the report all of the rows in the UID column have an "X" when I run the query only one of the rows in the UID column returns an "X". I run the query is SQL Mgmt studio. SO, I am very consfused why all of the columns when the report is ran return an "X" and when I run the query in SQL Mgmt studio only one row/record returns an "X"
0
 
LVL 27

Accepted Solution

by:
planocz earned 500 total points
ID: 38881935
The best way is to change your query.
To only give you the data that you need; based on the what condition you are looking for.
then just group the report by that condittion.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A recent questions about how to add SSRS named instances, couldn't find any that talks about SQL server 2008, anyway I decided to help by creating some screen shots. The installation is straightforward, you just pop the SQL server 2008 installati…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now