PDF parent and child

Hi!

I had 2 tables, company table and sub company table (company is the parent talble).
What kind of expression do I need to create to have a PDF where I can list the companys and in a second column of the PDF all the phone numbers that belong to the sub company that are related to?

With a parent/child relationship, you’ll have a Virtual Column on the parent record named something like “Related Subcompanys” - or whatever yo have chosen to name it.

You will have direct access to this Virtual Column in your template. To cycle through all the rows in that child list - “Related Subcompany” - you would use a <<Start:>>...<<End>> block in the template.

Below is an example. But you can format the row data in any manner the template allows. For instance you could have two template tables side-by-side. In the first (or left hand table) write your parent company information. In the second (right hand table) use the Start/End and write all of the Subcompany info.

In the example below, [Related Products] is a child list

Hi John!
Yes I understand your expression, but can I show in the company name in the left hand column and in the left hand column show there related products?
This expression will show me only the products and not the companys related to them.

Eg:

Sorry, I did not understand that you wanted to list ALL the companies on the same report. I assumed you would be generating for a single company at a time.

But that only means you need to include what I mentioned inside another Start/End block using s SELECT

For example:

<<Start:  SELECT(Companies[ID], true)>>

(parent table)     (Sub Company table with <<Start: [Related Subcompanies]>>
                                                                     (list sub company info)
                                                                  <<End>>)

<<END>>

In other words you can have nested Start/End.

This was a very quick response.  If you need more details let me know.
2 Likes

I will try out and let you know!

Thanks a lot with this help!
It works magically good!