Print n subdocument

my requirements is to print n copies of a subdocument related to the same document.
More in details, I want to print a proforma invoice as a subdocument of delivery note, and when I print a delivery note I want to print n copies of the proforma invoice (where n is a parameter from dynamic).
Can anyone help me to understand how to do?

Hi Flavia, I already answered the same question in the support ticket you raised and completely forgot to post the solution here in the forum :innocent:

What you ask is possible, so I would like to briefly describe the proposed approach for generating a dynamic number of copies of the proforma subdocument within the main delivery note document.

If you implement a dedicated data field that uses a separator (in my example the hyphen [-] character) for the number of copies, we can use the string-split function to create the required number of proforma copies in the final document:


In short, the number of hyphens in the BackOrderItemId string defines the number of copies in the generated report. You can find my test template and the generated PDF attached:

Document_4 copies.pdf (251.4 KB)
PackingSlip.Report__Proforma_-_with_string_split_to_create_copies.docx (121.0 KB)

Please let me know if you need additional information.