How to hide RDLC Table Column if no data is present in all the Rows with Expression? - rdlc

I would like to hide the entire column including the header if all the rows under that is null or of no values with expression in an RDLC Report.
I have tried the expression
"=IIF(IsNothing(Fields!de_projectactivityidname.Value), True, False)"
inside the "Visibility" of the Column property.
I would like to do this without any report parameters.
any help is appreciated.
Vinu

I think you were on the right track, but likely the field is never going to be null/nothing. Instead, it's likely to be an empty string.
This should work:
=IIF((Fields!de_projectactivityidname.Value = ""), True, False)

Related

DLookup returning True for some values, and False for others

I am writing a program, and I need to be able to check whether a certain 'tag' exists, by looking at all the 'tags' in the column 'CowTagMain' of the 'CowTable' table.
The code I am using is,
DLookup("[CowTagMain]", "[CowTable]", "[CowTagMain]") = Tag ...
Where tag is a String, TagMain is the column, and MainTable, is the table I am fetching data from.
I am getting inconsistent results, when I try this with 18C, it returns true. While if I try this with 18, it returns false.
I would assume I am fundamentally misunderstanding how to use DLookup, but after searching the internet for hours I cannot understand what I am doing wrong.
Even just pointing me in the right direction would be very appreciated! I am new to working with Access and VBA.
The search criteria is not within the function WHERE CONDITION argument.
The field is text type so need apostrophe delimiters.
Consider:
If IsNull(DLookup("[CowTagMain]", "[CowTable]", "[CowTagMain]= '" & Tag & "'")) Then

SSRS Calculated field with IIF expression gives #error when the condition is false

Hello I'm fairly new to SSRS and I'm working on making my first report for work. It has been going fine until today when I needed make a textbox in Tablix handle both a numbers calculation and text. A column in my SQL table that was previously a purely number field now has n|a for certain rows. So I wrote the following expression to handle those n|as. When the proceeds field is numeric the formula works, but when it's an n|a it shows up on the report as #error and I can't figure out why. I've removed all formatting from the textbox to the same result.
=IIF(Fields!Proceeds.Value<>"n|a",Fields!Proceeds.Value / Fields!DealBalance.Value,"n|a")
As TnTinMn explained, IIF always evaluates both the true and false part of the expression.
The simple fix is to do something like
EDIT Revised due to update from OP
=IIF(Fields!Proceeds.Value<>"n|a",VAL(REPLACE(REPLACE(Fields!Proceeds.Value,",",""),"$","")) / Fields!DealBalance.Value,"n|a")
This simply strips out the $ symbol and commas and then converts the text to a number using VAL(), if the text is not a number it will return zero which will not cause an error as the false part of your expression would give 0/DealBalance.

Using iff expression in rdlc report with null check keeps giving errors

In a rdlc report i'm using an expression to hide the row visibility.
If the expression is true the row is hidden.
The value of the field can be "Ja", "Nee" or Null. Only if it's "Ja" the row must be shown and the expression result should be false.
The expression
=Iif(Fields!Vleugel.Value Is Nothing,true,false)
is working but when I want to add the "Ja" condition like:
=Iif(Fields!Vleugel.Value Is Nothing,true,Iif(Fields!Vleugel.Value.Equals("Ja"),false,true))
it's causing an error like "Object reference not set to an instance of an object." when the field is null.
Can't figure out what's wrong since it's looks simular to examples I found.
If you use the Row Visilibily property you don't have to write an iif statement, it is enough to give the expression that will hide the row, try this:
=Fields!Vleugel.Value Is Nothing

SSRS expression and free text in the same textbox

Is it possible?
I would like to place the following inside a textbox:
There are =Count("MyDataSet") records found.
But if I place that in the expression on the textbox it just displays as above instead of getting the value.
Now I know if I were to split the above in two different textbox works ok but for spacing reasons it would be better if I could just use one?
Is that possible?
You need an expression in the textbox that specifies the text strings and concatenates these to your count value, something like:
="There are " & CountRows("MyDataSet") & " records found"

How to ignore blank criteria in queries in Access

I'm currently working with an update query, that works as expected until I add in criteria that makes the query not display any results (which I expected). The criteria is currently coming from textboxes on a form.
What I want to be able to do is, in the criteria line, specify that if the the textbox is blank with nothing in it, then the criteria should just skip that.
I've tried in the Criteria line:
[Forms]![Formname].[txtboxName] OR [Forms]![Formname].[txtboxName] Is Null
but that doesnt work.
Thank you for any help or guidance!
You should be able to use a wildcard:
Like [Forms]![Formname].[txtboxName] & "*"
How about:
where [whatever your field is] = [Forms]![Formname].[txtboxName]
OR Nz([Forms]![Formname].[txtboxName]) = ""
The use of Nz will catch both null values and zero length strings, which look null but are not.
If that doesn't work, please do as Remou requested. I.E. Update your question with the actual SQL query instead of just part of it.
try this:
Like IIF(IsNull([Forms]![Formname].[txtboxName])=Fasle;[Forms]![Formname].[txtboxName];"*")
*Note: my system default separator is ";", make sure what yours.
Enjoy the Ride