not able to hide the row using switch - ssrs-2008

I am using the below code to hide the code :
=switch(Fields!Switch_Login_Id.Value="",True,
Fields!Switch_Login_Id.Value="1",True,
Fields!Switch_Login_Id.Value="3118",True,false)
but it is giving the below error :
An error occurred during local report processing.
The Hidden expression for the text box 'Switch_Login_Id contains error: Argument 'VarExpr' is not a valid value.
The Hidden expression for the text box 'Switch_Login_Id contains error: Argument 'VarExpr' is not a valid value.
I can use the iif function to hide the result but just curious whether we can do it using SWITCH or not.

try amending the default like this:
=switch(Fields!Switch_Login_Id.Value="",True,
Fields!Switch_Login_Id.Value="1",True,
Fields!Switch_Login_Id.Value="3118",True,
True,false)

Related

Powershell error 'no method op_addition' when trying to use RowFilter with Variables

I have a small GUI containing a DataGridView that uses a DataTable as a datasource and want to add a Filterfunction. For this I made a dropdown that lets you choose a column and enter your filter next to it. Then when you press the Filterbutton it calls a function that should apply a RowFilter with the selected parameters. The problem is that I can't get the RowFilter Syntax to work. Either I get a Syntaxerror or Method invocation failed because [System.Data.DataColumn] doesn't contain a method named 'op_Addition'.
This is the function I'm using:
function DG-Filter {
$script:AWtable1.DefaultView.RowFilter = "$script:txtFilterListe.SelectedItem LIKE '%$script:txtFilter.Text%'"
$script:dataGridView1.Refresh()
}
What am I doing wrong? Do I have to use something like the String.Format() Method?
Full Script: https://controlc.com/436266af

Swift not allowing if statement because it dose not recognize an variable that is defined in the if statement

I am trying to get the input of a text field so that if the user is the one that is allowed in then their user credentials can be matched to a folder that is in the cloud but swift is giving the error "expected declaration" but there is no variable that is undefined. if anyone can help me then that would be greatly appreciated.
fist section of code second section of code
It's giving you the expected declaration error in your first screenshot because your if statement is not in the body of a function. You have to put your if statement in the body of a function.
func checkUserCredentials(){
if username_Input.text == "tyler" && password == ("1234"){
//do something
}
}

XML Expression Binding - Proceed Code in conditional operator

I am currently working on a Fiori app. At the moment I try to set a title depending on the value of a property I get from my OData service. Therefore I want to use expression binding with the conditional operator.
So when ${PROPERTIY} has the value "EXAMPLE", it should print the value of OUTPUT_PROPERTY_1. Otherwise, it should print the value of OUTPUT_PROPERTY_2.
XML:
<ObjectListItem title="{= ${PROPERTIY} === 'EXAMPLE' ? '${OUTPUT_PROPERTY_1}' : '${OUTPUT_PROPERTY_2}'}">
Unfortunately, it just prints ${OUTPUT_PROPERTY_1} or ${OUTPUT_PROPERTY_2}, and does not proceed the code to get the actual value of the properties.
Is there any chance to solve this problem or even a good workaround in order to print the actual value of the related property?
Remove the apostrophes around the expression binding syntax:
title="{= ${PROPERTIY} === 'EXAMPLE' ? ${OUTPUT_PROPERTY_1} : ${OUTPUT_PROPERTY_2}}"
Otherwise, '${OUTPUT_PROPERTY_x}' will be treated as a string literal.

Empty parameter in Crystal Reports Not showing NULL

I have a parameter that prompts the user to enter a value.
If that field is left blank I would think that the parameter would be NULL.
If I run:
isnull({?Param}) then
run this code...
The code does not run
BUT if I run it like:
hasvalue({?Param})
run this code...
The code runs!
Any idea why an empty param field does not return NULL?
From what I know,
hasvalue is used to check if a parameter has a value specified whereas IsNULL is mainly used in conjunction with a database field.
Which is why it may be behaving like that in your case.

How to pre select all values of input control by default in ireport

How to select all values of input control by default on the launch of the report?
If you are using a list input control and you have a fixed number of values in the list, you can select them by setting the Default Value Expression for your parameter to this (filling in the appropriate values):
java.util.Arrays.asList(new String[] {
"Value1",
"Value2",
"Value3"
});
If you make the input control optional, the user could leave the selection blank to select all values also. This is generally the way I do it.
Tom's solution works if report's scripting language is set to Java. Otherwise for Groovy it gives an error something like:
Errors were encountered when compiling report expressions class file: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: calculator_*: unexpected token
In the case where you have to use Groovy (e.g. for simpler date manipulation - $P{inputDate}.plus(1)), simply set Default Value Expression for your parameter to this:
["Value1","Value2","Value3"]