Home
Intelligence (Analytics)
Today date default value
joseiru
Hi!
How can I put today date as the default value in a Date parameter?
Thank you!
J.
Find more posts tagged with
Comments
cypherdj
The quick answer is no if you use a text box. What you could do however is use a ListBox with dynamic values. Create a dataset with the following query.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
select sysdate from dual
</pre>
<br />
However, you won't be able to override this default value at runtime.<br />
<br />
But, you could also add a checkbox and a date textbox to allow your user to override this value.<br />
<br />
But, yeah, complicated way of doing something rather simple ;-)
praposo
I also have been looking into this trying to create a dynamic date. Sometimes I need it to be set to the first day of the year, month or quarter. I found no clean cut solution to this yet!
joseforo
Hey,
I have the same problem, did you find any solution?
praposo
I eneded up using an external page in jsp to list my report parameters. Let me know if you need any help!
Pranna
Hi,
Can you plz let me know how to do the validation of date parameter.
Thanks.
dahweeds
I have gone round and round with this issue too.
the hack below works for my report:
sample query:
SELECT * FROM database.table WHERE someDate <= ?
then in the Parameters of the Edit Data Set widow and set up a new parameter like this
Name = todaysDate
Data Type = DateTime
Direction = Input
Default value =
- click on the Fx box and make a script to check your date parameter
if (params["today"].value == null){
theDate = new Date();
theDate;
} else {
params["today"].value;
}
close the box and it has worked for me when I use the show Report Parameters box. I have links to dates that came from the data base
in the report so people can send a date to the query to go back and
forward. You might have your page make a list box of dates or something
to send new dates to the report.
Please tell me if this can be improved. Or if it works for you?
Basarat
Here is a step by step how to that I used : <br />
<br />
<a class='bbc_url' href='
http://basaratali.blogspot.com/2009/05/birt-dynamic-parameters.html'>Basarat
Ali Syed: BIRT dynamic parameters</a><br />
<br />
That said. I like dahweeds solution as well, but I prefer something I can copy paste from one report to another