Solved

SSRS expression errors

Posted on 2013-02-01
4
360 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
Comment Utility
>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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

In this article I will describe the Detach & Attach 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.
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 video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

12 Experts available now in Live!

Get 1:1 Help Now