Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not displaying interim results on the reports #94

Open
Spirelabs opened this issue Apr 30, 2020 · 1 comment
Open

Not displaying interim results on the reports #94

Spirelabs opened this issue Apr 30, 2020 · 1 comment

Comments

@Spirelabs
Copy link

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

@ngslabex
Copy link

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants