How to Add a Subtotal Row to a DOCX Table
Keep subtotal and total rows attached to a DOCX table so they render as one complete table.
Last updated
Was this helpful?
Was this helpful?
[{{!<lineitemsSOQL>
<tableformat>]
| Product | Quantity | SubTotal |
| apples | 4 | $4 |
| oranges | 6 | $12 |
[</tableformat>
<soql>
SELECT Product2.Name, Quantity, TotalPrice
FROM OpportunityLineItem
WHERE OpportunityId = '{{!Opportunity.Id}}'
ORDER BY SortOrder
</soql>
<column>Product2.Name</column>
<column>Quantity</column>
<column format-number="#,###.##" prefix="$">TotalPrice</column>
</lineitemsSOQL>}}]
[<tableend>]
| | | Total |
| | | $16 |
[</tableend>]