Hello,
I'm totally new to freemarker and I have been struggling with the code bellow. I always get an error saying "[in template "body template for Document 'null' (null)"] ...-- Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value ... - Failed at: #assign secFotos = ... [in template "body template for Document 'null' (null)."
The image section can be visible or not, depending on the status of the equipment, Q05Q01.
The image question is optional, so it can contain an answer or not, Q21QCK07.
Any idea what am I doing wrong on the image part? After <#if value != "Not Operational">. The previous part works fine.
Thanks a lot!
<div class="page-break"></div>
<div class="page">
<div class="content">
<#list 1..10 as num> <!--1 lista contador-->
<#assign NumUnit = "U" + num?string("000") />
<#if answers.NumT[0] != "0"> <!--2 -->
<#list dataRecord.pages.PageXXXs.sections.SectionXXXs.rows as row> <!--3-->
<#list row.pages.XXXs.sections.SecXXXs.answers.Unit.values as valueX> <!--4-->
<#if valueX == NumUnit> <!--5 unidad igual contador-->
<#if row.pages.XXXs.sections.SecQ05.instances[0].answers.Q05Q01?has_content> <!--6 IF ESTADO-->
<#list row.pages.XXXs.sections.SecQ05.instances[0].answers.Q05Q01.values as value> <!--7-->
<#if value != "Not Operational"><!--8 if not operational secFotos is not visible-->
<#assign secFotos = row.XXXs.SecFotos.instances[0].answers.Q21QCK07 />
<#if secFotos.values?size > 0>
<!-- Display the image -->
<div>
<img src="data:${secFotos.values[0].contentType};base64,${secFotos.values[0].bytes}" alt="${secFotos.values[0].filename}" />
</div>
</#if>
<#else><!--8-->
</#if><!--8-->
</#list><!--7-->
<div class="page-break"></div>
<div class="page">
<div class="content">
</#if><!--6-->
</#if><!--5-->
</div></div>
</#list><!--4-->
</#list><!--3-->
</#if> <!--2-->
</#list> <!--1 lista contador-->
</div></div>
------------------------------
Alicia Rico
CI
Johnson Controls
------------------------------