logo

Using list parameters in reports

When creating reports you may need to filter data by several parameters. For example, by users, contractors, projects, etc. To learn more about creating reports, read this and this articles.

If you intend to filter several entries, use the Many-to-many link type in the parameter.

 

 

 The query will look like this:

Select *
from TableName
where
Property in (@Parameter)

In this case, entries will be filtered by the specified elements, but if you need to view all the entries without filtering by the parameter, the report will return an error. SQL does not allow checking a list for being null, that is why the possibility to check the list was added to the ELMA report generator. The query with the list check will look like this:.

Select * 
from TableName as tn
where
tn.Status <> 0
{if {$Parameter.Count} > 0 }
and
Property in (@Parameter)
{end if}

If no entries are selected in the list the parameter will be ignored.