ngs-doo / TemplaterExamples

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

Duplicate section #65

Closed albertobelardi closed 1 year ago

albertobelardi commented 1 year ago

Hi, I have a problem with the Templater process duplicating a section for me as in the screenshot I attached. Headings 1,2,3,4,5,6,7 are all level 1 however sections 2 and 4 are duplicated. How can this problem be resolved?

Thank you

image

This is the initial template that generates the document:

image

zapov commented 1 year ago

Hi @albertobelardi Its hard to tell without actual template or input data, ideally JSON. I can only assume you have some tag out of place which ends up resizing more than you want. If you have Templater Editor you could run it with debug option and it would tell you exactly when/why that happens.

albertobelardi commented 1 year ago

Hi @zapov I only have the "Developer Only" license, I don't have the Templater Editor, is there any other way to figure out where the problem is? I have invested many hours to find a solution, but I have not succeeded. Could I privately send you the data model and template so you can help me find the solution?

zapov commented 1 year ago

The usual way is through trial and error. Trying to make a smaller reproducible until you figured out whats wrong. The best I can do to help you is if you upload such small reproducible here to see whats wrong (what Editor will point to). So I suggest to strip private/sensitive information from the template, make it as simple as possible and provide JSON along which reproduces the wrong behavior.

albertobelardi commented 1 year ago

Hi @zapov I have attached a small solution in C# that generates an output.docx file, if you refresh the TOC of the documents you will see the duplicate. I also put the JSON model and the template. Thank you.

TestClient.zip

zapov commented 1 year ago

I've debugged your project in Templater Editor. You can see that after first resize it duplicates your entire document which is probably not what you wanted resize-issue To fix this you need to create a region around the part which you want to resize, eg if you create continuous section break before 1st section and before 2nd section, such as section-break Then this resize will only affect the region within this 2 section breaks. with-sections

albertobelardi commented 1 year ago

Thanks a lot for your support.