Skip to main content



      Home
Home » Archived » BIRT » Parameter UI - Set param Value/DefaultValue dynamically
Parameter UI - Set param Value/DefaultValue dynamically [message #243420] Tue, 19 June 2007 19:44 Go to next message
Eclipse UserFriend
Originally posted by: damian.delcampo.sealink.com.au

Hello,

I have date parameter in a report, this works fine and allows me to
manually enter a value such as 2007-06-19.

However I would like for this parameter to have a default value which is
dynamic - such as the current date or the current date minus 1 month etc.


How can this be achieved ????


I have set this parameter in the 'initialize' method of the report (
using params["paramDateEnd"].value = ..... ) however this seems to run
after the parameter UI is displayed.


Thank you kindly,
Damian
Re: Parameter UI - Set param Value/DefaultValue dynamically [message #243677 is a reply to message #243420] Wed, 20 June 2007 16:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Damian,

Try creating a scripted data source with the following scripts:

open
i=0;

fetch
if (i > 0 ){
return false;
}else{
importPackage( Packages.java.util );
sdd = new Date();
sdd.setDate(sdd.getDate() - 1);
row["dd"] = sdd;
i++;
return true;
}

Then create a combo dynamic parameter that uses the scripted data set
created.

Jason

Damian Del Campo wrote:
> Hello,
>
> I have date parameter in a report, this works fine and allows me to
> manually enter a value such as 2007-06-19.
>
> However I would like for this parameter to have a default value which is
> dynamic - such as the current date or the current date minus 1 month etc.
>
>
> How can this be achieved ????
>
>
> I have set this parameter in the 'initialize' method of the report (
> using params["paramDateEnd"].value = ..... ) however this seems to run
> after the parameter UI is displayed.
>
>
> Thank you kindly,
> Damian
Re: Parameter UI - Set param Value/DefaultValue dynamically [message #243757 is a reply to message #243677] Wed, 20 June 2007 21:37 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: damian.delcampo.sealink.com.au

Thanks for the reply Jason.

The problem with using a combo box to enter the date field is that there
would be a finite number of dates I can enter - this also becomes a very
non user friendly way of entering the date.

I need to find the way of accessing the UI elements just before the
parameter screen is rendered.
Do you know of the syntax of objects / function I could call to set the
value of these UI elements.


To be honest I'm a little preplexed that this is even an issue.

I'd have thought that date type parameters were probably the most used
in any reporting tool. Surely there are date type parameters calculating
a default value so that reports retain their usability through time.


Kind regards,
Damian


Jason Weathersby wrote:
> Damian,
>
> Try creating a scripted data source with the following scripts:
>
> open
> i=0;
>
> fetch
> if (i > 0 ){
> return false;
> }else{
> importPackage( Packages.java.util );
> sdd = new Date();
> sdd.setDate(sdd.getDate() - 1);
> row["dd"] = sdd;
> i++;
> return true;
> }
>
> Then create a combo dynamic parameter that uses the scripted data set
> created.
>
> Jason
>
> Damian Del Campo wrote:
>> Hello,
>>
>> I have date parameter in a report, this works fine and allows me to
>> manually enter a value such as 2007-06-19.
>>
>> However I would like for this parameter to have a default value which
>> is dynamic - such as the current date or the current date minus 1
>> month etc.
>>
>>
>> How can this be achieved ????
>>
>>
>> I have set this parameter in the 'initialize' method of the report (
>> using params["paramDateEnd"].value = ..... ) however this seems to run
>> after the parameter UI is displayed.
>>
>>
>> Thank you kindly,
>> Damian
Re: Parameter UI - Set param Value/DefaultValue dynamically [message #243940 is a reply to message #243757] Thu, 21 June 2007 10:58 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jasonweathersby.alltel.net

Damian,

There are jsp fragments that can be modified in the webconent directory,
but you probably do not want to alter them just for one report. The
reason I used a combo box is because the user could select the auto
generated date or type in a date. Another option is to use the tag lib
and use the param tag. This requires 2.2 but allows you to build your
own parameter screen.

Jason

Damian Del Campo wrote:
> Thanks for the reply Jason.
>
> The problem with using a combo box to enter the date field is that there
> would be a finite number of dates I can enter - this also becomes a very
> non user friendly way of entering the date.
>
> I need to find the way of accessing the UI elements just before the
> parameter screen is rendered.
> Do you know of the syntax of objects / function I could call to set the
> value of these UI elements.
>
>
> To be honest I'm a little preplexed that this is even an issue.
>
> I'd have thought that date type parameters were probably the most used
> in any reporting tool. Surely there are date type parameters calculating
> a default value so that reports retain their usability through time.
>
>
> Kind regards,
> Damian
>
>
> Jason Weathersby wrote:
>> Damian,
>>
>> Try creating a scripted data source with the following scripts:
>>
>> open
>> i=0;
>>
>> fetch
>> if (i > 0 ){
>> return false;
>> }else{
>> importPackage( Packages.java.util );
>> sdd = new Date();
>> sdd.setDate(sdd.getDate() - 1);
>> row["dd"] = sdd;
>> i++;
>> return true;
>> }
>>
>> Then create a combo dynamic parameter that uses the scripted data set
>> created.
>>
>> Jason
>>
>> Damian Del Campo wrote:
>>> Hello,
>>>
>>> I have date parameter in a report, this works fine and allows me to
>>> manually enter a value such as 2007-06-19.
>>>
>>> However I would like for this parameter to have a default value which
>>> is dynamic - such as the current date or the current date minus 1
>>> month etc.
>>>
>>>
>>> How can this be achieved ????
>>>
>>>
>>> I have set this parameter in the 'initialize' method of the report (
>>> using params["paramDateEnd"].value = ..... ) however this seems to
>>> run after the parameter UI is displayed.
>>>
>>>
>>> Thank you kindly,
>>> Damian
Re: Parameter UI - Set param Value/DefaultValue dynamically [message #244130 is a reply to message #243940] Thu, 21 June 2007 20:24 Go to previous message
Eclipse UserFriend
Originally posted by: damian.delcampo.sealink.com.au

Thanks Jason,

I'll have a crack at what you've suggested hopefully next week.

Kind regards,
Damian




Jason Weathersby wrote:
> Damian,
>
> There are jsp fragments that can be modified in the webconent directory,
> but you probably do not want to alter them just for one report. The
> reason I used a combo box is because the user could select the auto
> generated date or type in a date. Another option is to use the tag lib
> and use the param tag. This requires 2.2 but allows you to build your
> own parameter screen.
>
> Jason
>
> Damian Del Campo wrote:
>> Thanks for the reply Jason.
>>
>> The problem with using a combo box to enter the date field is that
>> there would be a finite number of dates I can enter - this also
>> becomes a very non user friendly way of entering the date.
>>
>> I need to find the way of accessing the UI elements just before the
>> parameter screen is rendered.
>> Do you know of the syntax of objects / function I could call to set
>> the value of these UI elements.
>>
>>
>> To be honest I'm a little preplexed that this is even an issue.
>>
>> I'd have thought that date type parameters were probably the most used
>> in any reporting tool. Surely there are date type parameters
>> calculating a default value so that reports retain their usability
>> through time.
>>
>>
>> Kind regards,
>> Damian
>>
>>
>> Jason Weathersby wrote:
>>> Damian,
>>>
>>> Try creating a scripted data source with the following scripts:
>>>
>>> open
>>> i=0;
>>>
>>> fetch
>>> if (i > 0 ){
>>> return false;
>>> }else{
>>> importPackage( Packages.java.util );
>>> sdd = new Date();
>>> sdd.setDate(sdd.getDate() - 1);
>>> row["dd"] = sdd;
>>> i++;
>>> return true;
>>> }
>>>
>>> Then create a combo dynamic parameter that uses the scripted data set
>>> created.
>>>
>>> Jason
>>>
>>> Damian Del Campo wrote:
>>>> Hello,
>>>>
>>>> I have date parameter in a report, this works fine and allows me to
>>>> manually enter a value such as 2007-06-19.
>>>>
>>>> However I would like for this parameter to have a default value
>>>> which is dynamic - such as the current date or the current date
>>>> minus 1 month etc.
>>>>
>>>>
>>>> How can this be achieved ????
>>>>
>>>>
>>>> I have set this parameter in the 'initialize' method of the report (
>>>> using params["paramDateEnd"].value = ..... ) however this seems to
>>>> run after the parameter UI is displayed.
>>>>
>>>>
>>>> Thank you kindly,
>>>> Damian
Previous Topic:Change in parameter doesn't go to Library Explorer
Next Topic:Side by side tables....
Goto Forum:
  


Current Time: Thu May 01 00:12:48 EDT 2025

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

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

Back to the top