Solved

SSRS expression errors

Posted on 2013-02-01
4
362 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

810 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