Syntax for template of "create a new file"

Hi.

I'm having difficulty creating a nested template for "create a new file". This template does not work.
The original template:

tablecolumnitem

<<Start: filter("table",and([ID]="table_d6db0799",1=1))>><<[name]>>

<<Start: filter("column",and([tableID]=[_thisrow-1].[ID],1=1))>>
<<[name]>>
<<Start: filter("item",and(1=1,1=1))>>
<<[description]>>
<<End>>
<<End>>
<<End>>

I'm running various tests to check why errors occur in the template.

First question
One of the difficulties is that I can't understand the difference between the following two templates:
The first template creates a PDF file, but an error occurs in the second template. The only difference between the two templates is that the location of <<END>>.

The first template:

tablecolumnitem

<<Start: filter("table",and([ID]="table_d6db0799",1=1))>><<[name]>>

<<Start: filter("column",and([tableID]=[_thisrow-1].[ID],1=1))>>
<<[name]>>
<<End>>
<<End>>

The second template:

tablecolumnitem

<<Start: filter("table",and([ID]="table_d6db0799",1=1))>><<[name]>>

<<Start: filter("column",and([tableID]=[_thisrow-1].[ID],1=1))>>
<<[name]>>

<<End>>
<<End>>

I would appreciate it if you could tell me why the second template does not work.

Second question
Also, I would appreciate it if you could let me know if there are any errors in "The original template".

Thank you.

Solved Solved
0 3 75
1 ACCEPTED SOLUTION

I can't be certain, but my guess is that the generator service doesn't understand how to split the the template table cells on each row inserted into your generated document when you have nesting in this manner.

You can place the outer loop OUTSIDE of the table, like this

<<Start: filter("table",and([ID]="table_d6db0799",1=1))>>

<<[name]>>

column item
<<Start: filter("column",and([tableID]=[_thisrow-1].[ID],1=1))>>
<<[name]>>

<<[item]>><<End>>

<<End>>

View solution in original post

3 REPLIES 3

I can't be certain, but my guess is that the generator service doesn't understand how to split the the template table cells on each row inserted into your generated document when you have nesting in this manner.

You can place the outer loop OUTSIDE of the table, like this

<<Start: filter("table",and([ID]="table_d6db0799",1=1))>>

<<[name]>>

column item
<<Start: filter("column",and([tableID]=[_thisrow-1].[ID],1=1))>>
<<[name]>>

<<[item]>><<End>>

<<End>>

@WillowMobileSys  Thank you for your reply.

There seems to be a limit to the number of nestings within the table. As you said, I would place the outer loop OUTSIDE of the table.

Thank you.


@leinharte wrote:

There seems to be a limit to the number of nestings within the table


It's more of an issue of being able to place the Start/End combinations so that the generation service can match them. For example, I believe an END in a cell can belong to only one expression.  Having 2 END's causes confusion and the second is likely ignored/not expected.

However, if you were to do something like the below, MAYBE it would work.  I have never tried it.

Group Detail 1 Detail 2 Group Total
<<START...Group expression>><<[Group Name]>> <<START...Detail expression>><<[Detail 1]>> <<[Detail 2]>><<END>> <<[Group Total]>><<END>>

I think, You can also having nested templates tables using merged cells in order to place your expressions.  It's hard to show here since we can't merge table cells, but it might be something like the below - imagine the white space are single template table cells.

 

Group Detail 1 Detail 2 Group Total

<<START...Group expression>><<[Group Name]>>

  <<START...Detail expression>><<[Detail 1]>> <<[Detail 2]>><<END>>  

                                                                                                                           <<[Group Total]>><<END>>

       
Top Labels in this Space