Check if element is in package

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

Check if element is in package

Postby jnicholas330 » Mon Jul 23, 2018 11:29 am


I have a report that uses VTL to generate Word documents. The report iterates over a class model, and hyperlinks attributes' types to their associated documentation. This is done with the bookmark capability

Code: Select all
$$attr.type.ID, $

The problem is that some types are not included in the package that I've included in the element scope. The bookmark code still creates a hyperlink, but the link goes nowhere. What I'd like to do is add a conditional that checks if the ID is in the current package (and any subpackages that it contains) being iterated over, and only then emit then hyperlink.

How can this be done?
Forum Newbie
Forum Newbie
Posts: 18
Posts Rating:4
Joined: Tue Jun 20, 2017 10:26 am

Re: Check if element is in package

Postby sarawut_w » Mon Jul 23, 2018 9:17 pm


The "$elements" is a default variable which is used for containing all elements in the selected scope.
You could check whether the "$attr.type" is in the selected scope or not, by this sample code:
Code: Select all

Best regards,
Sarawut W.
Support Engineer
No Magic
No Magic
Posts: 337
Posts Rating:23
Joined: Thu Jun 23, 2011 12:47 am

Return to Report Engine

Who is online

Users browsing this forum: No registered users and 1 guest