Display shared image on web problem

I am attempting to display an image (based on a department code) on a webfom. The the image is stored in the “Shared Images”

But its not producing what i expected…

I have the following code in “computed text” with passthru html.

Code :

svr := Server_Name;

db := @DbName;

@If(Department =“HR”; files := “logo1.jpg”;“”);

“http://” +Svr + “/” + db + “/” + files

Result :

http://www.domain.com//logo1.jpg, http://www.domain.com/pathname\dbname.nsf/logo1.jpg

ideally i want the second result only and to display the logo and not the text …

any sugesstions greatfully received.

Thanks R

Subject: display shared image on web problem …

It is a minor formula thing to get used to. What you need is

svr := Server_Name;

db := @DbName;

@If(Department =“HR”; files := “logo1.jpg”;“”);

(“http://” +Svr + “/” + db + “/”) + files

Subject: RE: display shared image on web problem …

hi,

same result i’m afraid…

R

Subject: RE: display shared image on web problem …

I had the right idea, but the wrong culprit. You should make it:

svr := Server_Name;

db := @Subset(@DbName; -1);

@If(Department =“HR”; files := “logo1.jpg”;“”);

(“http://” +Svr + “/” + db + “/”) + files

The problem is that the @DbName is a list of two elements, the first is the server (blank in your case), the second is the filepath. So, in your instance, the two elements propogate through the list. Of course, you might be even better off using

svr := Server_Name;

db := @WebDbName;

@If(Department =“HR”; files := “logo1.jpg”;“”);

“http://” +Svr + “/” + db + “/” + files

Subject: RE: display shared image on web problem …

Arghhh…

@WebDbOpen … that sorted out the duplicate.

So now i have the correct url, but how to display the image from the “Shared Images” instead of just the url ??

And the answer is :

svr := Server_Name;

db := @WebDbName;

@If(

Department =“HR”;files := “Logo1jpg”;

Department =“Test”;files :=“Logo2.jpg”;

Department =“-”;files := “no_image.jpg”;

“”

);

“<IMG SRC=” + “http://” +Svr + “/” + db + “/” + files + " WIDTH=" + “"100"” + “HEIGHT=” + “"150"” + “>”;

Many Thanks

R

Subject: RE: display shared image on web problem …

svr := Server_Name;db := @DbName;

@If(

Department =“HR”;

“http://” +Svr + “/” + db + “/logo1.jpg”;

“”

);

Subject: RE: display shared image on web problem …

hi,

again , same result i’m afraid…

R

am i missing somthing here … ??

Subject: RE: display shared image on web problem …

Among other things, you haven’t indicated that you are calling an image – the code is just creating a URL. And that URL is going to be a “stub” pointing to the database if the department is not HR. Your code should probably look something like this instead:

file := @If(Department=“HR”; “logo1.jpg”; Department=“SomeOtherDepartment”; “some_other_image.jpg”; “”);

@If(file=“”;“”;“<img src="/” + @WebDbName + “/” + file + “">”; “”)