NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: broche on February 03, 2015, 02:02:06 PM

Title: Image on a form
Post by: broche on February 03, 2015, 02:02:06 PM
Hi All,

Clarion 9.1
Nettalk 8.34

I want to display a photo of a staff member on the staff form.  I have looked at the posts but get a little confused as to the steps to do this.
I see the Image type, do I use that and point at a variable with the path to the photo?

Thanks
Title: Re: Image on a form
Post by: MyBrainIsFull on February 03, 2015, 02:11:43 PM
See image for steps, on the form
field type is image
the field to display can be from a tps file or a literal (C:\something\adam.jpg)
on the display tab set the image to the field

now you can see thi image and its location on the form

K

[attachment deleted by admin]
Title: Re: Image on a form
Post by: Keith on February 04, 2015, 01:34:07 AM
Hi

I am trying to display an image that I have successfully stored in a Blob field in a SQLite table.  On the Form I followed MBIF's instructions (I presume that the field Pro:ImageSmall is a Blob) but got a compile error - 'Variable expected' on the Blob field name.

So, is it possible to get the image in the Blob displayed on a Form?  What's missing?

Thanks

Keith
Title: Re: Image on a form
Post by: terryd on February 04, 2015, 01:46:10 AM
Hi Keith
Off topic a bit but beware of SqlLite if you want to use FM3 to upgrade since Bruce advised me that FM3  doesn't support it.
I looked at SqlLite and thought it would be useful but since I am an inveterate tinkerer as far as databases go this would be a showstopper for me.
Title: Re: Image on a form
Post by: MyBrainIsFull on February 04, 2015, 01:48:35 AM
Hi Kieth, no my example is not a blob
the handling of a sql table that has a blob is handled in depth in Bruces pdf  "Building Web Applications with NetTalk - Second Edition.pdf"  on pages 74 and 75
"Serving From Blobs "

I dont feel its right to make large extracts from his book without his permission, as the book took him over a week to write.  

The book is found in the Clarion shop
Title: Re: Image on a form
Post by: terryd on February 04, 2015, 04:04:34 AM
Although I know Bruce likes being called Superman I think that it took an awful lot longer than a week to write ;-)
Title: Re: Image on a form
Post by: Keith on February 04, 2015, 01:06:31 PM
Hi all responders

I have a copy of 'the book' so no worries there  :)

What I want to do is to display on a Form the content of a jpg which is stored in a Blob which is what I thought Brian also wants.  Is this possible?

I have watched 4 Webinars (so far) and learned a lot about Blobs and their use but not how to display a photo on a Form (from a Blob)

The main thrust of allowing photos to be uploaded via File Upload is to store the photo in a folder and the full name of the photo file in the database.  I have successfully stored photos and displayed on a Form using that method but wondered if you could do it directly from the Blob - maybe not.

Terry, on the question of SQLite - I was really just experimenting because one of the functions I want to perform is to export a tps table so that another organisation can load it into their own DB (say MSSQL) and I originally achieved that by writing a comma delimited (ASCII) file from tps.  This worked fine but then  'add photos' was suggested so I though that maybe if I stored the photos in SQLite Blobs and just gave them the SQLite DB that they could extract easier from that 'SQL' DB. I'm not wedded to SQLite and take your points.

Second-lastly, it is worth noting that storing photos in a tps file is probably not a good idea because of the 2GB file size limit - that could easily be breached.

Lastly, Brian, displaying staff photos on a form works if the photo is a separate file and you just point to that.

Cheers

Keith
Title: Re: Image on a form
Post by: broche on February 06, 2015, 09:09:56 AM
Thanks all,
I will use a jpg on the server in a specific location.

Brian.