Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » report parameters ALL_DATES or (START_DATE, END_DATE)
report parameters ALL_DATES or (START_DATE, END_DATE) [message #153673] Fri, 14 April 2006 22:16 Go to next message
Stan Jordan is currently offline Stan JordanFriend
Messages: 31
Registered: July 2009
Member
This scenario is common:
1. The db has a date column, and other columns with interesting stuff.
2. The user wants to see the "interesting stuff" either for "all dates" or
for a "range" of dates.
I don't see how to implement this neatly with Birt RCP Designer. One
approach is to demand that the user always supply both the start and end
dates. But this is awkward because before the report is created, he does
not know the range of dates in the db. If he wants all the data, for all
dates, he really wants to simply say "all dates". It seems like I need a
two-step process, in which I first ask, "Do you want ALL_DATES or a
RANGE_OF_DATES? If he answers RANGE_OF_DATES, then I ask him to provide the
start and end dates.
Anybody know how to do this with Birt RCP Designer? Thanks.
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #153706 is a reply to message #153673] Sat, 15 April 2006 16:06 Go to previous messageGo to next message
Der Spunk is currently offline Der SpunkFriend
Messages: 58
Registered: July 2009
Member
Hi,
i would suggest the following approach:
1. Use two parameters for the start and end dates. These parameters will be
visible to the end user and they are optional.
2. Use two hidden parameters that will be computed


"Stan Jordan" <stan_jordan@earthlink.net> schrieb im Newsbeitrag
news:e1p70a$mki$1@utils.eclipse.org...
> This scenario is common:
> 1. The db has a date column, and other columns with interesting stuff.
> 2. The user wants to see the "interesting stuff" either for "all dates"
> or
> for a "range" of dates.
> I don't see how to implement this neatly with Birt RCP Designer. One
> approach is to demand that the user always supply both the start and end
> dates. But this is awkward because before the report is created, he does
> not know the range of dates in the db. If he wants all the data, for all
> dates, he really wants to simply say "all dates". It seems like I need a
> two-step process, in which I first ask, "Do you want ALL_DATES or a
> RANGE_OF_DATES? If he answers RANGE_OF_DATES, then I ask him to provide
> the
> start and end dates.
> Anybody know how to do this with Birt RCP Designer? Thanks.
>
>
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #153714 is a reply to message #153673] Sat, 15 April 2006 17:12 Go to previous messageGo to next message
Der Spunk is currently offline Der SpunkFriend
Messages: 58
Registered: July 2009
Member
Sorry, while writing i accidentally hit the "Post" button. So, player shoot
again:

1. Use two report parameters "pr_start" and "pr_end" for the start and end
dates. These parameters will be visible to the end user and they are
optional.

2. Create your data set query with four data set parameters in this order:
pd_ignore_start, pd_start, pd_ignore_end, pd_end

3. In the WHERE clause of your SQL statement enter something like
select ... from ... where
/* other filter conditions */
and (1=? or start_date >= ?)
and (1=? or end_date <= ?)

4. In the report create a table and in the binding of the data set
parameters specifiy the following:
Parameter: pd_ignore_start, Value: if (params["pr_start"] == null) {1} else
{0}
Parameter: pd_start, Value: params["pr_start"]
Parameter: pd_ignore_end, Value: if (params["pr_end"] == null) {1} else {0}
Parameter: pd_end, Value: params["pr_end"]

This way the user is not forced to enter a date. The filtering is only
applied if the user entered a value in the start date and/or end date filter
field.

So far i haven't found an easier solution. Any other suggestions?


"Stan Jordan" <stan_jordan@earthlink.net> schrieb im Newsbeitrag
news:e1p70a$mki$1@utils.eclipse.org...
> This scenario is common:
> 1. The db has a date column, and other columns with interesting stuff.
> 2. The user wants to see the "interesting stuff" either for "all dates"
> or
> for a "range" of dates.
> I don't see how to implement this neatly with Birt RCP Designer. One
> approach is to demand that the user always supply both the start and end
> dates. But this is awkward because before the report is created, he does
> not know the range of dates in the db. If he wants all the data, for all
> dates, he really wants to simply say "all dates". It seems like I need a
> two-step process, in which I first ask, "Do you want ALL_DATES or a
> RANGE_OF_DATES? If he answers RANGE_OF_DATES, then I ask him to provide
> the
> start and end dates.
> Anybody know how to do this with Birt RCP Designer? Thanks.
>
>
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #154962 is a reply to message #153714] Thu, 20 April 2006 20:51 Go to previous messageGo to next message
Stan Jordan is currently offline Stan JordanFriend
Messages: 31
Registered: July 2009
Member
Dear Der,
The suggestions below are excellent (many thanks!). Now I have similar
problem:
A table contains many rows, a column of interest is "NameOfPatient", and the
same patient can appear in more than one row.
I want to allow the user to get all rows for one particular patient, or the
whole shebang (the entire table).
I have created a dynamic report parameter (Combo Box) listing the patients,
so he can pick one. But how do I allow him to select "all patients"? The
Combo Box is not optional, so he must pick something from the Combo Box.
But the Combo Box contains only patient names--it does not have a row saying
"all patients".
Thanks
Stan

"Der Spunk" <spunk_der@hotmail.com> wrote in message
news:e1r9hh$opf$1@utils.eclipse.org...
> Sorry, while writing i accidentally hit the "Post" button. So, player
> shoot again:
>
> 1. Use two report parameters "pr_start" and "pr_end" for the start and end
> dates. These parameters will be visible to the end user and they are
> optional.
>
> 2. Create your data set query with four data set parameters in this order:
> pd_ignore_start, pd_start, pd_ignore_end, pd_end
>
> 3. In the WHERE clause of your SQL statement enter something like
> select ... from ... where
> /* other filter conditions */
> and (1=? or start_date >= ?)
> and (1=? or end_date <= ?)
>
> 4. In the report create a table and in the binding of the data set
> parameters specifiy the following:
> Parameter: pd_ignore_start, Value: if (params["pr_start"] == null) {1}
> else {0}
> Parameter: pd_start, Value: params["pr_start"]
> Parameter: pd_ignore_end, Value: if (params["pr_end"] == null) {1} else
> {0}
> Parameter: pd_end, Value: params["pr_end"]
>
> This way the user is not forced to enter a date. The filtering is only
> applied if the user entered a value in the start date and/or end date
> filter field.
>
> So far i haven't found an easier solution. Any other suggestions?
>
>
> "Stan Jordan" <stan_jordan@earthlink.net> schrieb im Newsbeitrag
> news:e1p70a$mki$1@utils.eclipse.org...
>> This scenario is common:
>> 1. The db has a date column, and other columns with interesting stuff.
>> 2. The user wants to see the "interesting stuff" either for "all dates"
>> or
>> for a "range" of dates.
>> I don't see how to implement this neatly with Birt RCP Designer. One
>> approach is to demand that the user always supply both the start and end
>> dates. But this is awkward because before the report is created, he does
>> not know the range of dates in the db. If he wants all the data, for all
>> dates, he really wants to simply say "all dates". It seems like I need a
>> two-step process, in which I first ask, "Do you want ALL_DATES or a
>> RANGE_OF_DATES? If he answers RANGE_OF_DATES, then I ask him to provide
>> the
>> start and end dates.
>> Anybody know how to do this with Birt RCP Designer? Thanks.
>>
>>
>
>
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #154975 is a reply to message #154962] Thu, 20 April 2006 21:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dolphycj.xxxxxxxxxxx.com

The same technique works again.

Add All to the choices and have your query include ('All'=? OR
NameOfPatient=?) in the query parameter. You can then do a similar
javascript to set the first parameter to 'All' if they select all and to
null the second parameter.
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #154990 is a reply to message #154975] Thu, 20 April 2006 22:23 Go to previous messageGo to next message
Stan Jordan is currently offline Stan JordanFriend
Messages: 31
Registered: July 2009
Member
Chris:
The list of patients (filling Combo Box) comes from a Data Set that I get
from a db Query. How do I add 'All' to the choices in the Combo Box?
Thanks
Stan

"Chris Dolphy" <dolphycj@xxxxxxxxxxx.com> wrote in message
news:fcb2c5e52d8b97670b6ec232a37b571d$1@www.eclipse.org...
> The same technique works again.
>
> Add All to the choices and have your query include ('All'=? OR
> NameOfPatient=?) in the query parameter. You can then do a similar
> javascript to set the first parameter to 'All' if they select all and to
> null the second parameter.
>
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #154998 is a reply to message #154990] Thu, 20 April 2006 23:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dolphycj.xxxxxxxxxxx.com

You could modify your query that returns the parameter choices to union in
the All choice.

For example, this is how you do it for Oracle:
SELECT NAME FROM TABLE
UNION ALL
SELECT 'ALL' FROM DUAL
Re: report parameters ALL_DATES or (START_DATE, END_DATE) [message #155005 is a reply to message #154998] Thu, 20 April 2006 23:09 Go to previous message
Stan Jordan is currently offline Stan JordanFriend
Messages: 31
Registered: July 2009
Member
Many thanks Chris!

"Chris Dolphy" <dolphycj@xxxxxxxxxxx.com> wrote in message
news:371f775f9be58cc348160a8ffb9d0fb9$1@www.eclipse.org...
> You could modify your query that returns the parameter choices to union in
> the All choice.
>
> For example, this is how you do it for Oracle:
> SELECT NAME FROM TABLE
> UNION ALL
> SELECT 'ALL' FROM DUAL
>
>
>
Previous Topic:Using Javascript to access report design parameters
Next Topic:How to suppress duplicate data
Goto Forum:
  


Current Time: Thu Jun 27 19:22:01 GMT 2024

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

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

Back to the top