Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » In an expression, testing if a type date parameter is null is not working
In an expression, testing if a type date parameter is null is not working [message #248228] Mon, 16 July 2007 21:52 Go to next message
Nicolas Thuillier is currently offline Nicolas Thuillier
Messages: 17
Registered: July 2009
Junior Member
Hi,

I have the result of a query in a table of 2 columns:
- connection_number
- connection_date

The connection date column is type Date (format yyyy/M/d)
I have a report parameter of type Date (called myDate) with the format
yyyy/M/d
and as default value: null value

What I want is to apply a filter to my table:
If the report parameter myDate is empty then display all the entry
Else only display the entry whose the connection date corresponds to the
date entered in the MyDate parameter

In the filter panel, I try the following expression:
(params["myDate"] == null || row["connection_date"] == params["myDate"])
operator Is True
But the expression is not working.

If I try the following filter:
row["connection_date"] == params["myDate"] is True, it is working

but if I try:
params["myDate"] == null is true, it is not working.


If I try
expression: params["myDate"] and operator: Is Null, it is working.
But I cannot separate the expression in 2 filters expression. I want an
"OR" filter and filters working as "AND".

It seems params["myDate"] == null is not working in an expression.

Do someone know how I can test if a report parameter of type date is null?
Or How I can do to apply the filter I want?

Thanking you in advanced for your help.
Re: In an expression, testing if a type date parameter is null is not working [message #248249 is a reply to message #248228] Tue, 17 July 2007 01:37 Go to previous messageGo to next message
Tianli Zhang is currently offline Tianli Zhang
Messages: 2862
Registered: July 2009
Senior Member
Hi Nicolas

I have tried your cases, only the case: params["myDate"] and operator: Is
Null works. And the case row["connection_date"] == params["myDate"] is
True failed in my build, so what is the version of your build? I hope to
reproduce all your cases to find the issue.

Regards!
Re: In an expression, testing if a type date parameter is null is not working [message #248265 is a reply to message #248228] Tue, 17 July 2007 01:51 Go to previous messageGo to next message
Tianli Zhang is currently offline Tianli Zhang
Messages: 2862
Registered: July 2009
Senior Member
Hi Nicolas,

I think we can not use simple compareble "==" to compare date type values.
So I found a workaround to solve this:
You can try birt functions: BirtComp.equalTo()

Example:
BirtComp.equalTo(params["myDate"],null) is True
BirtComp.equalTo(row["connection_date"], params["myDate"]) is True

Good luck:)
Re: In an expression, testing if a type date parameter is null is not working [message #248295 is a reply to message #248228] Tue, 17 July 2007 02:34 Go to previous messageGo to next message
Tianli Zhang is currently offline Tianli Zhang
Messages: 2862
Registered: July 2009
Senior Member
Hi

Another solution is:

params["myDate"].value == null is True

But there has a issue row["date"]==params["myDate"].value is True doesn't
work. I have logged a
bug(https://bugs.eclipse.org/bugs/show_bug.cgi?id=196766)to investigate
this issue

Regards
Re: In an expression, testing if a type date parameter is null is not working [message #248310 is a reply to message #248295] Tue, 17 July 2007 05:39 Go to previous messageGo to next message
Nicolas Thuillier is currently offline Nicolas Thuillier
Messages: 17
Registered: July 2009
Junior Member
Hi Tianli

First, let me thanking you for your precious help. Your solutions work
very well.

Effectively, you are right:
row["date"]== params["myDate"].value is True doesn't work for me either. I
was thinking it was. Sorry to have written a wrong case.

Nicolas
Re: In an expression, testing if a type date parameter is null is not working [message #248520 is a reply to message #248310] Wed, 18 July 2007 00:18 Go to previous message
Tianli Zhang is currently offline Tianli Zhang
Messages: 2862
Registered: July 2009
Senior Member
You are welcome, thanks for using BIRT and welcome to give BIRT more
suggestions.

Regards!
Previous Topic:Crosstab aggregate on problem
Next Topic:XLS and word Render option in BIRT 2.2.
Goto Forum:
  


Current Time: Wed Sep 17 05:40:03 GMT 2014

Powered by FUDForum. Page generated in 0.09115 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software