Report boolean parameter error

I am trying to use some boolean report parameters in an HTML report. But when I try to run the report, with both true and false values for the boolean parameter, it throws this error

FreeMarkerException: For "#if" condition: Expected a boolean, but this has evaluated to a string (wrapper: 
==> po.fields.WAFER  [in template "testreport.html" at line 9, column 25]

When I was testing this feature some months ago, it was working. Am I doing something wrong here? (78.9 KB)


Freemarker interprets NULL WAFER as String and doesn’t handle it. Freemarker works well for not-NULL WAFER values (interprets as boolean).
You can check not null in the IF condition, e.g.:
<#if Root.bands.po[0].fields.WAFER?hasContent && Root.bands.po[0].fields.WAFER>HI</#if>

Thank you





The value of the parameter going in is not null. It is being set to true. The default value of the parameter is false. But it still isn’t evaluating the parameter. This is the part that I am having trouble with. I am attaching the new project with the changes to the report. (79.9 KB)

You can try to access WAFER field of the po band, but po band doesn’t return anything. In you sample it returns: return [[:]]. You will need change band script to return parameter value: return [['WAFER': params['WAFER']]]

The modification to the groovy script does work when I try it. However my confusion comes from the fact that this does not appear to match the docs. External Report Parameters - CUBA Platform. Report Generator This says that
All external parameters become fields for each report band, so you can use them directly in the template as dataset fields. I understand this to mean that WAFER should be accessible, unaltered, from the po band. Is this understanding incorrect?