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)
Default month and year
purushdk
Hi
i am using birt 2.3.1
in the report i am using two parameters like Month and year,
1 .month i am using static value:
i need to display current month as default parameter.
its possible, Kindly give example
Thanks & Regards,
k.purushothaman
Find more posts tagged with
Comments
mwilliams
Hi k.purushothaman,<br />
<br />
Take a look at this thread:<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/forum/eclipse-birt-newsgroup-mirror/11028-initializing-date-param-current-day.html'>http://www.birt-exchange.org/forum/eclipse-birt-newsgroup-mirror/11028-initializing-date-param-current-day.html</a><br
/>
<br />
It should give some guidance.
purushdk
Hi
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();
var curr_year = d.getFullYear();
params["Month"] = curr_month;
params["Year"] = curr_year;
i have added above code in th initialize method to populate current month an current year but its not working.
Please give me some example.
mwilliams
k.purushothaman,
Can you create a sample report attached to the sample database showing what you're trying to do and let me know where it's not working for you? If you're wanting the default value in the parameter box to show the current month and current year, the example I linked you to might be the best way. It creates values for a dataSet for yesterday, today, and tomorrow using a scripted dataSet. You can then create your parameters dynamically based on this dataSet and use them where needed in your report. If this doesn't work for you, let me know when you set up the sample report showing what you're trying to do. Thanks.
purushdk
Hi
Parameter passing as current month ant current year, but parameter we are setting some default value there i need to set current month and current year
Thanks & Regards,
k.purushothaman