I need to filter the report data in BIRT based on the year selected in the report parameter. If I select 'Current Year' from the parameter, it should only return me the data for 2020 year and not previous year.
Please find the attach screenshot for the report result I'm getting. I have applied the filter for 'Planned Start' field to check if it's for current year. Please find the below condition that I have written for filtering on dataset.
var cy = BirtDateTime.year(BirtDateTime.today());
var py = BirtDateTime.year(BirtDateTime.today())-1;
var c = row["triTask__triWorkTask____triPlannedStartDT"];
var b = new Date(Formatter.format(row["triTask__triWorkTask____triPlannedStartDT"],"dd/mm/yyyy"));
var a = BirtDateTime.year(b);
if (params["Year"].value == 'Current Year')
{
if(a==cy)
{true}
}
if (params["Year"].value == 'Previous Year')
{
if(a==py)
{true}
}
Please suggest me if I'm doing anything wrong here.