Help needed: Calculating media image

I have a media field where we store images. I am creating a report and want to display an icon IF we have an image for the record. I have tried this several ways and have confirmed the name of the image in servoy. Anyone have any idea WHY this is not working? Here is my calc (returning type “Media”)

if( pphoto != null || pphoto != '')
{
	return "media:///photo_portrait.jpg";
}

Thanks in advance

what you need to use is this:

"media:///servoy_blobloader?servername=myServer&tablename=myTable&dataprovider=icon&rowid=6"

ApeWare:
I have a media field where we store images. I am creating a report and want to display an icon IF we have an image for the record. I have tried this several ways and have confirmed the name of the image in servoy. Anyone have any idea WHY this is not working? Here is my calc (returning type “Media”)

if( pphoto != null || pphoto != '')

{
return “media:///photo_portrait.jpg”;
}




Thanks in advance

that code should work oke.

did you set the field also too media-field??

Yes, field is Media type.

Patrick,

I am not familliar with that method. Does that do basically the same thing?

Fixed it. “.jpg” != “.png”

Thanks for the help.

The blobloader loads an image from a table, not the Servoy media library. I wasn’t sure where your image is…