Is there a difference between Null, (Null) and Nothing in SSRS? - ssrs-2008

My apologies if this is a very easy question.
So In SSRS you can choose either (Null) from a drop-down , or Null, or use an expression with VBs Nothing keyword.

I created a test case. Create a parameter called "TestParam" with three possible values:
(Null) (The prefilled available value)
An expression set to =nothing
Typing "Null" into the value box (as shown in the screen shot.)
The parameter must be set to allow null values to save the first of these.
Then created a dataset:
SELECT
"Valid Row Returned"
WHERE
#TestParam IS NULL
This returned a row if the parameter was set to the prefilled (Null) or =nothing. It did not return a row if the parameter was set to "Null" as shown in the screenshot.

Related

How to create a display,or similar, method with paramater?

in my myForm I call in a tableMY a displayMethod_fieldA.
In myForm I insered a some date in a DateEdit and I want to make a selection in table using the entered value. If I crete a displayMethod whit parameter I have an error.
Look like this code I get error:
display myEDTField displayMethod_fieldA (date _dateFromForm)
{
tableMY table;
select table
where table.item == this.item
&& table.dateTable == _dateFromForm;
return table.valueFieldA;
}
I have an error looklike this:
The display method has an incorrect parameter profile.
There is another way to display or set the value in my StrinEdit in Grid by method passing a parameter?
In web I saw the method modifier modifierMothod , but I need some more explanation. I don't know if this method is a right way.
Display methods are not designed with this feature.
display method for a table, form, report, or report design does not
have any parameters. For example: display Amount amount()
A display method for a form data source does require a parameter. You
use the
parameter to specify a table buffer. The type of the table buffer has
to match the type of the table in the form data source.
https://msdn.microsoft.com/en-us/library/aa595058.aspx
You can create the desired behaviour with an edit method (and setting the field to AllowEdit(false) or enabled(false).

Variable returns null at first row in report

I am using Jaspersoft Studio for building reports.
I have a variable which actually checks a column TODAY has null values of not. Expression of that value is
$F{TODAY} == null ? new BigDecimal(0.00) : $F{TODAY}
TODAY column has null values in my case for now.
The problem is first the expression above returns null for the first row and zero for the other rows. It should return 0 for every row since TODAY column is null
What can be the reason for that?
The problem is leaving "initial value expression" part empty.
I added the same expression also to that field and it works fine now.
Same problem here. The older fix of use same expression for Initial Value does not work for me, because the first two rows now have same value.
I end up fix it by on iReport, changing the Variable:Property:Reset Type: to None.
i had a similar problem and i fixed it by setting 'evaluation time' of the 'Text Field' showing the variable to 'Auto' instead of 'Now' in jasperSoft Studio

Parameter Field issue

I am having a problem with one of my parameter fields. I have YES to show all the results with yes on, and NO for all of those with no on, on other parameter fields if i leave the field as "..." it will show both yes and no. I don't seem to be able to select "..." as a default value. When i click "..." in the parameter field no results are shown.
please see the below screenshots relevant to this column:
Image 1
Image 2
Image 3
Image 4
If you require any more information, please ask.
thank you,
'...' isn't a value that can be set. It is what is displayed when a value hasn't been chosen.
You can either:
make it an optional parameter; see Conditionally prompting for optional parameters
make it a multi-select parameter and look for the presence of one or the other or both
In both cases, it would be easier for you if you used a Boolean parameter rather than a String.

SSRS date default with formula disables parameter

When I set a default value formula for a date parameter in SSRS, such as:
=CDate(”01/” & Month(Now) & “/” & Year(Now))
or even:
=Now
the date parameter control becomes disabled with nothing in it. Does anyone know what simple thing (I am sure) I am doing wrong?
After playing some more, I realized that the date controls became enabled when I picked a value from a preceding dropdown parameter that did not have a default. Apparently, controls after non-default parameters are disabled until you pick something, so order matters.
From an MDSN article:
"parameter order is important when you want to show users the default value for one parameter before they choose values for other parameters"
http://msdn.microsoft.com/en-us/library/cc281392.aspx
I experienced the same and the problems lies on the USER ID parameter that I set to internal visibility but without any default value. When I put in default value or set this to null, the date parameter was enabled.. (User ID parameter comes before the date parameter on my case)
Now is a function and you must use like =Now()
maybe it is your problem.

JasperReports: default value instead of 'null'

Is there any way to set a default value to a field in a report? I have a lot of String fields in a report and would like them to display "0,00" when they're null.
Supposing the field name is "value", in the "Text Field Expression", write:
($F{value} != null) ? $F{value} : "0.00"
You can also select "Blank when null" in the properties of the text field if you want that. Other options are more flexible but this does the trick very quick and easy.
medopal's answer is good, but 2 additions:
1) You can make the syntax shorter:
($F{field_name}) ? $F{field_name} : "0.00"
2) Make sure your "else" data is of the same class as the field's value, otherwise you'll get errors when it tries to coerce numbers into string, etc. etc. This was something that, as I started out, I mixed up.
Did you try set a pattern in the text field?
If you are using iReport this can be found in the properties for the text field in the Text Field Properties section.
Try something along the lines of ###0.00 to represent 1234.56, which would always display 0.00 even if it is null.
This is the easiest way is to use Coalesce() or NVL() function of database in your data-source query to restrict null data on your report.
But it depends on if you are allowed to change the datasource query or not. If not then you can go for other solutions provided in previous answers.