?
Solved

SSRS expression errors

Posted on 2013-02-01
4
Medium Priority
?
368 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 66

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 2000 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

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 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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

718 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