I wish to print parent and child record in the PDF. This pdf has the records list of records selected by the users. Yellow colour represents child records and green colour represent parent records.
For this kind of layout, you need to use nested START expressions - One for parents and one for children. BUT because the Child table is in its own formatted table spanning several lines in the PDF and part of the parent, the START expression for the parent must be OUTSIDE of the Parent data table template. Something like the image below.
@AleksiAlkio and @MultiTech some where in your post I have seen [_THISROW] -1 logic**,** to pull the grand child records. can you please share the link ?
Doubt : for generating PDF , Should I pull the grand child records to the parent table ( virtual column : type : list) by using select () function like which was done usually for pulling child records or template itself knows to pull the grand child records even if the grand child records are not available in parent table?
Why it doesn’t pull the grand child records ? should [PDF REPORT] be printed in template to make the expression to work ? since expression has [_thisrow-1].[PDF REPORT].
Note :
key values of the [PDF REPORT] is no where printed in the template, just other columns like date, customers names are printed
PDF REPORT is a virtual column with the type : LIST in the table with the condition that pulls records from another table consignment.
Error encountered in step with name [PDF STEP]: Error: Task ‘PDF STEP’ Body template. Expression ‘Select(consignments Articles[Article Number],in([CONSIGNMENTS SL NO],[_thisrow-1].[CONSIGNMENTS SL NO]))’ is invalid due to: Parameter 2 of function IN is of the wrong type. Error: Task ‘PDF STEP’ Body template. Start expression ‘Select(consignments Articles[Article Number],in([CONSIGNMENTS SL NO],[_thisrow-1].[CONSIGNMENTS SL NO]))’ should generate a List of Ref values. Please verify that it generates a List and that the contents of the List are Ref values. Ref values should come from the ‘Key’ column of the referenced table. Error: The document body is empty
When inside a Start, you can just reference the [Related whatever] column in the inner Start expression. Remember that Start: changes your context to the table you are referencing records from
The IN() function checks if a value is an element in a LIST of values. The column [CONSIGNMENTS SL NO] is likely not defined as a List type. You could wrap the value like this: LIST([_THISROW-1].[CONSIGNMENTS SL NO]), to force the IN() function to work.
But why use IN() if a straight equal comparison works?