How do i insert a database value within a string in designer

Stimulsoft Reports.PHP discussion
Post Reply
dasdee
Posts: 2
Joined: Sun May 11, 2014 3:06 am

How do i insert a database value within a string in designer

Post by dasdee »

Hi,
How do i replace part of a text with a value from a data source. I am trying to replace a part of a text/string with a value from a datasource. I want to use IIF to check whether the user has a picture, if no, i show the default picture if yes i show the user picture by replacing or appending the user id(picture name) within the file path. Example below:

{IIF((DataSource1.PIC_STATUS ==1),"/abcde/files/pictures/"DataSource1.User_ID".jpeg", "/abcde/files/icons/default_picture.jpeg")}
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How do i insert a database value within a string in desi

Post by HighAley »

Hello.

Please, try to use next expression:

Code: Select all

{IIF((DataSource1.PIC_STATUS ==1),"/abcde/files/pictures/"+DataSource1.User_ID+".jpeg", "/abcde/files/icons/default_picture.jpeg")}
Thank you.
dasdee
Posts: 2
Joined: Sun May 11, 2014 3:06 am

Re: How do i insert a database value within a string in desi

Post by dasdee »

Hi,
thanks a lot, it works perfectly as i wanted.
Regards.
Andrew
Posts: 4108
Joined: Fri Jun 09, 2006 3:58 am

Re: How do i insert a database value within a string in desi

Post by Andrew »

Great! Thank you for letting us know about this.
Post Reply