Closed tecxx closed 4 years ago
Hi @tecxx
It should work fine on latest .NET
Can you please upload the template. And it would be very helpful to provide some code to recreate the data, or JSON representing the same data.
here is the stripped down template, removed all but the relevant parts https://web.tresorit.com/l/zT5AQ#1HNFzKegL9t1EIqENW8D5Q for code&json i try to provide a sample project in the coming days
Tnx.
I took a look at your example... and there are two main issues:
1) you probably want to put checksInScope.scopeData.findings
in something resizable, like a list (or nested table)
2) there is a bug with .Count handling in checksInScope.scopeData.findings
which I'll fix in next version, but you can work around it like you did, or via some other plugin.
So the main problem in 1) is that when there are 0 findings, resize(tags, 0) gets called, which deletes the whole row. You probably want to remove only the part related to finding listing, but for that to work as expected you need to put it into a nested resizable object
The problem 2) looks like a bad handling of resize 0 and property of a list. You can actually make a workaround by using {{checksInScope.scopeData.findings}:count}
to avoid adding the extra findingsCount property on a list... by registering a formater which will return number of elements in a collection
Also, instead of using different nesting element, you can put the entire findings in second row, merge cells in other columns and setup borders on table/cells. TemplatePentestReport.docx
I've tested with this JSON:
{"checksInScope":{"scopeData":[
{"id":"1","title":"t1","findingsCount":2,"findings":[
{"id":"f1","title":"ft1","rating":"fr1"},
{"id":"f2","title":"ft2","rating":"fr2"}
]},
{"id":"2","title":"t2","findingsCount":0,"findings":[
]},
{"id":"3","title":"t3","findingsCount":3,"findings":[
{"id":"f5","title":"ft5","rating":"fr5"},
{"id":"f6","title":"ft6","rating":"fr6"},
{"id":"f7","title":"ft7","rating":"fr7"}
]},
]}}
thanks for your prompt reply. adding a table for findings worked (and now also .Count shows the correct result). now i understand what you mean in your documentation with "table without borders", so in case something repeats we should simply add a "dummy" table as a repeating element?
regarding your second reply, i tried that as well and understand what you suggest. could you check the file that you uploaded though? it contains just my original table, was that your intention?
thanks again - i will close this and continue some more tests.
Yes, I removed everything else, just to showcase that part
i'm still not over the basics, could you be so kind and answer me one more question.
i am trying to show "no data" when a collection is empty. based on the documentation i should use [[tag]:empty(string)] while this works when the collection is actually empty ("no data" is shown), it displays a very strange output when data exists:
Its calling to string on the object. You need to put additional metadata on it (or write your own instead of empty) - eg: hide There is an example here: https://github.com/ngs-doo/TemplaterExamples/tree/master/Intermediate/CollapseRegion
thanks, i could solve it!
Hello, i'm very interested to put this library into our inhouse management software, but before we decide to go ahead and buy a license we'd like to get some basic tests working.
this is the word template:
and this is the result:
here's the simplified data model:
and here's the debugger, to prove the data model is correct:
edit: just remembered, this project is on .net 5 rc2. is this supported?