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 18:16  |
Eclipse User |
|
|
|
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 12:06   |
Eclipse User |
|
|
|
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 13:12   |
Eclipse User |
|
|
|
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 16:51   |
Eclipse User |
|
|
|
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.
>>
>>
>
>
|
|
| | | | |
Goto Forum:
Current Time: Tue May 06 13:12:19 EDT 2025
Powered by FUDForum. Page generated in 0.03142 seconds
|