senaite.impress icon indicating copy to clipboard operation
senaite.impress copied to clipboard

Not displaying interim results on the reports

Open Spirelabs opened this issue 4 years ago • 1 comments

Steps to reproduce

Create a calculation that has several interim fields (in my case, an average of 5 interim fields). Tick the option to report the interim fields. Create a sample that requires this calculation. Enter some figures into the interim fields and publish the results

Current behavior

No interim fields are displayed on the reports

Expected behavior

The interim fields should be displayed on the reports

Screenshot (optional)

Calculation page Calculation page Sample Analysis Published results Results

Spirelabs avatar Apr 30 '20 07:04 Spirelabs

Could you try this: https://github.com/senaite/senaite.impress/blob/master/src/senaite/impress/templates/reports/Default.pt#L424

                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[0].get('formatted_value', '') if len(interims) > 0 else '')"></span>
                        <span tal:content="python: interims and (interims[0].get('unit', '') if len(interims) > 0 else '')"></span>
                      </tal:interim_fields>
                    </td>
                    <!-- Thickness 2 -->
                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[1].get('formatted_value', '') if len(interims) > 1 else '')"></span>
                        <span tal:content="python: interims and (interims[1].get('unit', '') if len(interims) > 1 else '')"></span>
                      </tal:interim_fields>
                    </td>
                    <!-- Thickness 3 -->
                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[2].get('formatted_value', '') if len(interims) > 2 else '')"></span>
                        <span tal:content="python: interims and (interims[2].get('unit', '') if len(interims) > 2 else '')"></span>
                      </tal:interim_fields>
                    </td>
                    <!-- Thickness 5 -->
                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[3].get('formatted_value', '') if len(interims) > 3 else '')"></span>
                        <span tal:content="python: interims and (interims[3].get('unit', '') if len(interims) > 3 else '')"></span>
                      </tal:interim_fields>
                    </td>
                    <!-- Thickness 5 -->
                    <td class="analysis">
                      <tal:interim_fields
                          define="interims python:view.get_result_variables(analysis)"
                          condition="interims">
                        <span tal:content="python: interims and (interims[4].get('formatted_value', '') if len(interims) > 4 else '')"></span>
                        <span tal:content="python: interims and (interims[4].get('unit', '') if len(interims) > 4 else '')"></span>
                      </tal:interim_fields>
                    </td>

ngslabex avatar Apr 28 '24 20:04 ngslabex