Home
Analytics
Fetch number of days for each month based on Date Report Parameter in BIRT Report
MAX092012
Hi ,
I have a birt report which has report parameter on the date field i.e. Start Date and End Date hence user can run this report for 1/3/6 months or an year. Now what I have is based on this report parameter I need to fetch the number of days of each months.
For example,
Start date - 1 Jan 2020
End date - 31 March 2020
I need to fetch
Jan - 30 days
Feb - 29 days
March - 31 days
Is there any BIRT functionality to get this done ?
Find more posts tagged with
Magellan BI & Reporting
Comments
jfranken
Use BirtDateTime.month() to get the start and end months. Then use standard JavaScript to generate the result. One possibility is to create an array with the months and days, then loop through the array from the start month to the end month. Add logic for leap years.