#import inside an #if

Uploaded report templates and discussions about reports.

Moderators: sarawut_w, Moderators

#import inside an #if

Postby fmejia5@ford.com » Fri Mar 18, 2022 11:23 am

Hi,
I'm trying to do an #import statement inside of an #if but it seems like the VTL parser always runs the #import.
Is there a way to conditionally do the #import?

Code: Select all
#if($version.contains("21x"))
#import('ref', 'com.nomagic.reportwizard.custom.CustomReferenceTagHandlerTool')
#end


I've also tried doing this but the Report wizard complains:

Code: Select all
#if($version.contains("21x"))
#set($dir = 'com.nomagic.reportwizard.custom.CustomReferenceTagHandlerTool')
#else
#set($dir = 'com.nomagic.reportwizard.tools.script.JavaScriptTool')
#end
#import('ref', $dir)
fmejia5@ford.com
Forum Beginner
Forum Beginner
 
Posts: 34
Posts Rating:2
Joined: Tue Apr 28, 2020 2:34 pm

Return to Report Engine

Who is online

Users browsing this forum: No registered users and 0 guests