Output the dbvalue in an attribute in Custom Template Body (v2021)

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
darkdragon
User
Posts: 150

Output the dbvalue in an attribute in Custom Template Body (v2021)

Post by darkdragon »

Hello,

We have a recent project converted from ANM2020 to ANM2021.

In a Summary Report, we have in CustomTemplateBody data displayed on two rows.
On the second row, we put as an attribute of the <tr> the dbvalue of a field.
We need this as an attribute in order to highlight (all days which are displayed as columns) employees who worked below their schedule.

Example:

<tr data-rowindex="{{{row_cnt}}}" class="ew-table-row">
	<td> ...</td>
	...
</tr>
<tr data-rowindex="{{{row_cnt}}}" class="ew-table-alt-row" data-dh="{{: {{{dbvalue DailyHours}}} }}">
	<td> ...</td>
	...
</tr>

The page load with a cshtml render error: The name 'k' does not exist in the current context
The cshtml page is rendered with the second row as follows (the k doesn't exists as a variable):

<tr data-rowindex="@(j)" class="ew-table-alt-row" data-dh="{{: ~root.rows[@(k - 1)].DailyHours }}">

Ideas how to fix this?


darkdragon
User
Posts: 150

Post by darkdragon »

Found a temporary fix for my problem by moving the value as a hidden td.
And found out in docs that summary reports do not support {{{dbvalue field}}}


Post Reply