List of Entities as Report Paremeter - Null Value

I am having an issue when using a report parameter of type “List Of Entities”. My report is a SQL query and I am using the parameter in my WHERE clause. The parameter works when a value or multiple values are selected, however when no value is supplied for this parameter I am presented with an error. My WHERE clause reads:

WHERE
(Ticket.[STATUS]) = ${TicketStatus}
AND
(Ticket.TICKET_NUMBER) >= ${TicketFrom}
AND
(Ticket.TICKET_NUMBER) <= ${TicketTo}
AND
(Ticket.CREATE_TS) >= ${CreatedDateFrom}
AND
(Ticket.CREATE_TS) <= ${CreatedDateTo}
AND
(Ticket.UPDATE_TS) >= ${UpdatedDateFrom}
AND
(Ticket.UPDATE_TS) <= ${UpdatedDateTo}
AND 
(CreatedMember.Id) IN ${CreatedByMembers}

Looking at the error message it looks like the null value is not being handled properly for the CreatedByMembers parameter and nothing is getting passed in to the SQL statement. Here is an excerpt from the error message:

WHERE 1=1 and 1=1 and 1=1 and 1=1 and 1=1 and 1=1 and 1=1 AND
_(CreatedMember.Id) IN ) Parameters: []_
_Incorrect syntax near ')'._

The other null parameters get replaced with the 1=1 statements however the “List Of Entities” does not and nothing is passed in.

Any help would be appreciated. Thank you,

Corey Amoruso

Hi,

Thank you for reporting the problem. We have created YouTrack issue: https://youtrack.cuba-platform.com/issue/YARG-58

SQL dataset supports query preprocessing with Groovy (https://doc.cuba-platform.com/reporting-6.8/structure_sql.html#query_preprocessing). If collection value is empty or null it’s you can try not add IN clause in the SQL query.

Thanks,
Andrey