ngs-doo / TemplaterExamples

Creating reports in .NET and Java
https://templater.info
The Unlicense
48 stars 27 forks source link

Is there a way we can nest a Table or a Paragraph in a resizable List #68

Open khurramfarooq opened 5 months ago

khurramfarooq commented 5 months ago

I am trying to nest a Table/Paragraph into resizable List but doing so, the list only resize to the first element of the collection. The rest of the elements in the array are ignored.

zapov commented 5 months ago

Can you please provide: template, JSON and expected output?

khurramfarooq commented 5 months ago

templater-files.zip @zapov if you see the generated output, below are the few issues I have noticed:

  1. The presence of a table below the list results in only the first item of the collection being displayed, while the remaining items are ignored.
  2. Upon descending into a nested list, any enclosed elements or those positioned beneath the list relocate to the bottom of the resizable list instead of adjusting or repeating alongside the parent list.
  3. The generated output displays the entire list repeated twice. Attempting to enclose the entire list between continuous section breaks, did not resolve this issue.
zapov commented 5 months ago

Can you please provide the correct JSON, as the one you provided does not work with the template.

khurramfarooq commented 5 months ago

input-json.json @zapov I have updated the json. Please check if that works.

zapov commented 5 months ago

It seems what you want to do here is duplicate entire range from 1.1.1.2 list item up to end of the document. Templater will resize lists and tables in place when you send it a collection, thats why that Changes duplicates to 2 list items. So if you want instead to duplicate extended range from that, you need to mark such range more explicitly. One way to do that is to repeat that same tag from a list later in a paragraph. So when Templater detects tag which is not in a list or a table, it will resort to section duplication, and since I added section just above your list it will duplicate this entire section up to end of the document. That will give you the behavior you are expecting: Template-ranges.docx