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: 
f.t.SimpleScalar):
==> 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?
testProject.zip (78.9 KB)

Hi,

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

image

image

image

image

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.

testProject.zip (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. https://doc.cuba-platform.com/reporting-6.9/parameters.html 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?