Help needed: Calculating media image

Home for older / inactive topics

Help needed: Calculating media image

Postby ApeWare » Wed May 31, 2006 5:18 pm

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
User avatar
ApeWare
 
Posts: 114
Joined: Sat Aug 28, 2004 11:49 am
Location: Richmond, VA

Postby patrick » Wed May 31, 2006 5:29 pm

what you need to use is this:

Code: Select all
"media:///servoy_blobloader?servername=myServer&tablename=myTable&dataprovider=icon&rowid=6"
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Re: Help needed: Calculating media image

Postby Harjo » Wed May 31, 2006 5:38 pm

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??
Harjo Kompagnie
ServoyCamp
Servoy Certified Developer
Servoy Valued Professional
SAN Developer
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby ApeWare » Wed May 31, 2006 5:41 pm

Yes, field is Media type.
User avatar
ApeWare
 
Posts: 114
Joined: Sat Aug 28, 2004 11:49 am
Location: Richmond, VA

Postby ApeWare » Wed May 31, 2006 5:44 pm

Patrick,

I am not familliar with that method. Does that do basically the same thing?
User avatar
ApeWare
 
Posts: 114
Joined: Sat Aug 28, 2004 11:49 am
Location: Richmond, VA

Postby ApeWare » Wed May 31, 2006 5:55 pm

Fixed it. ".jpg" != ".png"

</brainfart>

Thanks for the help.
User avatar
ApeWare
 
Posts: 114
Joined: Sat Aug 28, 2004 11:49 am
Location: Richmond, VA

Postby patrick » Wed May 31, 2006 5:57 pm

The blobloader loads an image from a table, not the Servoy media library. I wasn't sure where your image is...
Patrick Ruhsert
Servoy DACH
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany


Return to Archive

Who is online

Users browsing this forum: No registered users and 0 guests