Background Color:
 
Background Pattern:
Reset
Search

Forum

Please Log In

We want you to contribute! 

This forum is a moderated environment. 
We try to keep it neat and tidy. In order to access the forum content we would like you to either or register.

HomeHomeScryberScryberDevelopment Que...Development Que...Filepath with Variable in it?Filepath with Variable in it?
Previous
 
Next
New Post
5/5/2016 7:39 PM
 

Afternoon,

 

I'm looking to pull a variable into a filepath that is currently hardcoded.

Currently the hardcoded script is

<pdf:Image src="..//images/items/JV-AC.png" />

 

The "JV-AC" is currently being passed to me as {xpath:optionsalfields/optionalfield[@name='DIVCODE']/value}.

 

How do I massage this to make it concatenate the relative file path with the DIVCODE variable and then add the .PNG extension to the end?

 

 

 
New Post
5/5/2016 9:19 PM
 

Hi jwellwood

The xpath binding statement is a fully qualified xpath expression so you should simply be able use the concat function

{xpath:concat('../images/items/',expression,'.png')}

 

Word of warning that the image either has to exist or missing images should be allowed in the configuration (http://www.scryber.co.uk/HowTo/tabid/133/Default.aspx?topic=Scryber+Configuration)

You can hide by binding to the visible attribute of the image (or one of it's containers) but the path would still be evaluated and attempted.

 
New Post
5/5/2016 9:58 PM
 

Thanks,

 

See below, i'm getting an error when I run this.  Feedback on my syntax?  Error is 

Server Error in '/' Application.

'concat('..//images/items/',{xpath:optionalfields/optionalfield[@name='DIVCODE']/value},'JV-AC.png')' has an invalid token.

My script below -

<pdf:Image src="{xpath:concat('..//images/items/',{xpath:optionalfields/optionalfield[@name='DIVCODE']/value},'JV-AC.png')}" style:width="3in" />

 
New Post
5/7/2016 3:30 PM
 

Hi - the inner '{xpath: ...}' declaration is not required (as the whole statement is an xpath statement). So...

 

<pdf:image src="{xpath:concat('..//images/items/',optionalfields/optionalfield[@name='DIVCODE']/value,'JV-AC.png')" style:width="3in"/>

 
Previous
 
Next
HomeHomeScryberScryberDevelopment Que...Development Que...Filepath with Variable in it?Filepath with Variable in it?