Is this a correct way to format totalls:

<frx:fields>
...
	<frx:field id="=sum(*/total_weight_deliv)" format="number" format-string="9 999.99"/>
</frx:fields>

...

	 <tfoot>
		<tr>
...
		<td style="text-align: right;">{=sum(*/total_weight_deliv)}</td>
		</tr>
	 </tfoot>
...

It is working for me.

Will it not cause some duplicate computing resource use?

Comments

janeks created an issue.

metzlerd’s picture

No it will not do the calculation twice, and this is perfectly legal. The formatting is matching based on ID, which is the token Technically you could create a separate calc field if you wanted, but this will suffice.

janeks’s picture

Hm, how to create "separate calc" field?

metzlerd’s picture

  .... 
  <frx:field id="sum_total_weight" calc="sum(*/total_weight_deliv)" format="number" format-string="999.99"/>
  ... 

  <body>
  .... 
     {sum_total_weight}

For advanced users ---- The really amazing thing is that expressions can contain token replaced fields AND you and use context= attribute to make the xpath expression run against other data blocks.