You are not logged in.
Hello all!
Is there something way to add a parameter to a query only if the parameter value is provided? Something like $X{LESS, column, parameterkey} that can create a true condition (0=0) but that would do an IN or same thing that EQUALS do....
Given my use case I can use $P!{} but I thought I'd ask if there is some safer way to add a part of the WHERE clause conditionally based on the presence or not of a parameter value.
Maybe ${} can be used to check if a parameter is present and then issue $X{EQUAL...} or $X{IN....}, ? i don't know if that works, i'll need to play with it....
Offline
Ok, it can definitely be done using supported EL (thank you Reports Server!) one can add clauses to the WHERE conditionally using something like:
WHERE true $!{(empty selectRecords) ? '' : "AND id IN (".concat(selectRecords).concat(")")}
Offline