Page 1 of 1

Help needed: Calculating media image

PostPosted: Wed May 31, 2006 5:18 pm
by 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")
Code: Select all
if( pphoto != null || pphoto != '')
{
   return "media:///photo_portrait.jpg";
}


Thanks in advance

PostPosted: Wed May 31, 2006 5:29 pm
by patrick
what you need to use is this:

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

Re: Help needed: Calculating media image

PostPosted: Wed May 31, 2006 5:38 pm
by Harjo
ApeWare wrote: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")
Code: Select all
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??

PostPosted: Wed May 31, 2006 5:41 pm
by ApeWare
Yes, field is Media type.

PostPosted: Wed May 31, 2006 5:44 pm
by ApeWare
Patrick,

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

PostPosted: Wed May 31, 2006 5:55 pm
by ApeWare
Fixed it. ".jpg" != ".png"

</brainfart>

Thanks for the help.

PostPosted: Wed May 31, 2006 5:57 pm
by patrick
The blobloader loads an image from a table, not the Servoy media library. I wasn't sure where your image is...