Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Displaying date
arjunmanju
Hi all,
i am passing the default value for date field...assume 1000-01-01 as start date and 9999-01-01 as end date.
but when the user does not enter the date and generate the report i don't want to display the date as 1000-01-01 and 9999-01-01 ... instead i need to display % only in case if use does not enters the date.. or else if date is entered by user then respective date must be displayed ...
example :
Parameters
start date : [empty]
end Date : [empty]
now in report its showing default value as
start date : jan 1,1000
end Date : jan 1,9999
instead of this i want to get it as
start date : %
end Date : %
when no data is entered....
if start date : 2011-01-01
end Date : 2011-09-01
then i should get dynamic text as
start date : jan 1, 2011
end Date : sep 1,2011
i need this to be done dynamically...... but problem is date type does not support %
So please suggest how to achieve
Find more posts tagged with
Comments
mcremer
This you can do as folowing.<br />
<br />
In properties you go to visabilety of the data object.<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(params[["start date"].value !== null) {
true;
}else {
false;
}</pre>
<br />
Then you make a label with the % in it and set the visabliety with this code:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if(params[["start date"].value !== null) {
false;
}else {
true;
}</pre>
<br />
This will look weard in design. But in the actual report it looks nice and clean.
arjunmanju
Hi mcremer,
Thank you for your reply, I understand your solution but that's not exactly what i want..
I want to display the % only when the date is say for example '1000-01-01' or else if the date is other than '1000-01-01' I need to display the date which is entered say for example '1001-01-01'
example :
if the user enter date as '1000-01-01' as Parameters say..
start date : 1000-01-01
In report (Dynamic Text) i want it as
start date : %
if date is any other value than '1000-01-01' i need to display the date itself as it is instead of %
if start date : 2011-01-01
In report i should get in report as (Dynamic Text)
start date : jan 1, 2011
end Date : sep 1,2011
I want dynamic text to display based on values which the user enter....
Please suggest me how to achieve and soon ....
arjunmanju
Hi Can you tell me how to use this script in dynamic text field and also please suggest me how to compare a date parameter in script
if (params["StartDate"].value == "1000-01-01")
{
(false);
Packages.java.lang.System.out.println("%");
}
else
{
params["StartDate"].value
}
when i run this the loop is directly going to else part so please suggest
arjunmanju
Hi all,<br />
<br />
<br />
I found a soln to the problem. Actually ?==? operator is not working for dates. So whenever you want to overcome above situation Please check it <br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>if (BirtComp.equalTo(params["ReceivedDateFrom"].value,"1000-01-01"))
{
"%"
}
else
{
params["ReceivedDateFrom"].value
}
</pre>