The blue and yellow elements are related, but only through other intermediate elements. So you could say they have a ‘virtual’ relationship. The good news is that we can easily print them with eaDocX, without having to show any of the intermediate elements, and without having to write a script.
In eaDocX, open the profile of your source element, and choose “Advanced relationships”. This opens a dialogue where you can choose the relationship type and target element for each hop, and add any number of hops, until you get to the end point of your traceability (see the eaDocX Help for more information).