Solved

SSRS expression errors

Posted on 2013-02-01
4
365 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Introduction In the following article I’ll be discussing and demonstrating several different ways of how images can be put on a report. I’m using SQL Server Reporting Services 2008 R2 CTP, more precisely version 10.50.1352.12, but the methods ex…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 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