I am using Apex Office Print 21.1. I have two data sets returned by queries like this:
Main:
| store | register | qty |
|---|---|---|
| 100 | ALL | 30 |
| 200 | ALL | 120 |
| 300 | ALL | 60 |
and Details:
| store | register | qty |
|---|---|---|
| 100 | 1 | 10 |
| 100 | 2 | 20 |
| 200 | 1 | 30 |
| 200 | 2 | 40 |
| 200 | 3 | 50 |
| 300 | 1 | 60 |
In the docx / excel templates, I would like to have them displayed with groups like that:
main Store 100, register ALL, qty 30
detail Store 100, register 1, qty 10
detail Store 100, register 2, qty 20
main Store 200, register ALL, qty 120
detail Store 200, register 1, qty 30
detail Store 200, register 2, qty 40
detail Store 200, register 2, qty 50
main Store 300, register ALL, qty 60
detail Store 300, register 1, qty 60
How to achieve that with Apex Office Print?
Thank you :)
I tried with breaks, but I stuck on how to display only details connected to specific Main stores. Is there any way to compare break|store from Main with break|store from details?
Here is my code: AOP template with breaks
{#aopireportdata_1|break:"STORE"}{break[0].STORE} {#break}{STORE} {REGISTER} {QTY} {/break}
{#aopireportdata_2|break:"STORE"}{break[0].STORE} {#break}{STORE} {REGISTER} {QTY}{/break} {/aopireportdata_2|break:"STORE"}{/aopireportdata_1|break:"STORE"}
and the result of it: the result of this template