Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » dataset filter in subreports(using report date parameters to filter sub-reports)
icon12.gif  dataset filter in subreports [message #869088] Wed, 02 May 2012 23:55 Go to next message
Mike Johnson is currently offline Mike JohnsonFriend
Messages: 11
Registered: March 2012
Junior Member
I have startdate and enddate (datetime format) in the main report that I want to filter the subreport and it doesn't seem to be working. The date fields in the subreport is date format, while the start and end date report parameters in the main report are datetime, could that be the cause the the filter note working?

Also I'm not sure how the dataset filters work. Example if A+B=C (true) I use "Is True" to test the condition and it doesn't seem to work. if I say A+B=C (true) and i use "Is False" it seems to work.... I'm confused. LOL
Re: dataset filter in subreports [message #869676 is a reply to message #869088] Thu, 03 May 2012 16:46 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike

Can you post the report?
If you are using the is true filter, your expression must return true
for the row to appear in the results. See attached example which uses
this expression:

if( row["QUANTITYORDERED"] > 30 ){
true;
}else{
false;
}

This will filter out rows that have a qty ordered less than or equal to
30. I realize this may sound counter intuitive :>

Jason

On 5/2/2012 7:55 PM, Mike Johnson wrote:
> I have startdate and enddate (datetime format) in the main report that I
> want to filter the subreport and it doesn't seem to be working. The date
> fields in the subreport is date format, while the start and end date
> report parameters in the main report are datetime, could that be the
> cause the the filter note working?
>
> Also I'm not sure how the dataset filters work. Example if A+B=C (true)
> I use "Is True" to test the condition and it doesn't seem to work. if I
> say A+B=C (true) and i use "Is False" it seems to work.... I'm confused.
> LOL
Re: dataset filter in subreports [message #869703 is a reply to message #869676] Thu, 03 May 2012 22:14 Go to previous messageGo to next message
Mike Johnson is currently offline Mike JohnsonFriend
Messages: 11
Registered: March 2012
Junior Member
... and this will work as well with dates i.e.
if (startDate >= paramStartDate)
true;
else
false;


...filter "is true" --- accept records that are greater or equal to the main report report startDate parameter.

i was wondering if the main report startdate parameter is "datetime" and the database report startdate field is "date" format will the logic test still work?
Re: dataset filter in subreports [message #869861 is a reply to message #869703] Fri, 04 May 2012 14:56 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike

Try an expression like:

if( BirtComp.greaterThan(row["ORDERDATE"],
params["datetimefilter"].value) ){
true;
}else{
false;
}

See attached example.

Jason

On 5/3/2012 6:14 PM, Mike Johnson wrote:
> ... and this will work as well with dates i.e. if (startDate >=
> paramStartDate)
> true;
> else
> false;
>
>
> ...filter "is true" --- accept records that are greater or equal to the
> main report report startDate parameter.
>
> i was wondering if the main report startdate parameter is "datetime" and
> the database report startdate field is "date" format will the logic test
> still work?
Re: dataset filter in subreports [message #869863 is a reply to message #869703] Fri, 04 May 2012 14:56 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike

Try an expression like:

if( BirtComp.greaterThan(row["ORDERDATE"],
params["datetimefilter"].value) ){
true;
}else{
false;
}

See attached example.

Jason

On 5/3/2012 6:14 PM, Mike Johnson wrote:
> ... and this will work as well with dates i.e. if (startDate >=
> paramStartDate)
> true;
> else
> false;
>
>
> ...filter "is true" --- accept records that are greater or equal to the
> main report report startDate parameter.
>
> i was wondering if the main report startdate parameter is "datetime" and
> the database report startdate field is "date" format will the logic test
> still work?
Re: dataset filter in subreports [message #869864 is a reply to message #869703] Fri, 04 May 2012 14:56 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike

Try an expression like:

if( BirtComp.greaterThan(row["ORDERDATE"],
params["datetimefilter"].value) ){
true;
}else{
false;
}

See attached example.

Jason

On 5/3/2012 6:14 PM, Mike Johnson wrote:
> ... and this will work as well with dates i.e. if (startDate >=
> paramStartDate)
> true;
> else
> false;
>
>
> ...filter "is true" --- accept records that are greater or equal to the
> main report report startDate parameter.
>
> i was wondering if the main report startdate parameter is "datetime" and
> the database report startdate field is "date" format will the logic test
> still work?
Re: dataset filter in subreports [message #869867 is a reply to message #869703] Fri, 04 May 2012 14:56 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Mike

Try an expression like:

if( BirtComp.greaterThan(row["ORDERDATE"],
params["datetimefilter"].value) ){
true;
}else{
false;
}

See attached example.

Jason

On 5/3/2012 6:14 PM, Mike Johnson wrote:
> ... and this will work as well with dates i.e. if (startDate >=
> paramStartDate)
> true;
> else
> false;
>
>
> ...filter "is true" --- accept records that are greater or equal to the
> main report report startDate parameter.
>
> i was wondering if the main report startdate parameter is "datetime" and
> the database report startdate field is "date" format will the logic test
> still work?
Previous Topic:BIRT not able to use TypeFace when creating styles
Next Topic:Line-wrapped data field with horizontal lines?
Goto Forum:
  


Current Time: Thu Apr 18 15:01:51 GMT 2024

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

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

Back to the top