FoxPro/jpg file control.
I am using vfp 9.
I have ten student's jpg file in pict folder.
I am creating student information system in vfp9.
I want store student's jpg with student record. in dbf and display on form and report also
pl. help me sir,
Displaying the image on forms and reports is fairly easy, but storing the picture in the DBF is something I have not been able to figure out. I'll give you the theory, maybe you'll have better luck. You can add a field to your table to store the image. When you create the field, the field type should be GENERAL. This field can be used to store images, spreadsheets, etc. To store data, use the INSERT GENERAL command. Now, the problem: I've never been able to get the picture to store. It seems to store the icon and that's all I get when I try to add it to a report or a form.
However, if you can live with keeping only the file name of the image in your database, and keeping the JPG as separate files, everything else will work. Control and the proper object are a little different between forms and reports...
ON A FORM:
Use "Image" as your object type. Use the "Picture" property to determine what image is to be displayed. At design time, you can leave this property as (none). The property should be assigned during the forms initialization (INIT Method) using:
THISFORM.<ImageObjectName>.Picture = <FieldName>
(FieldName from the table storing the name of the JPG file).
ON A REPORT:
Use "Picture/OLE Bound Control" as the object type. Open the "Properties" window; on the "General" tab, select "Expression or Variable Name" from the Control Source Type radio group. The next item, "Control Source" is the name of the field in the table which has the file name of the image.
If you have additional questions/issues, please post a follow-up.
P.S. Please enter a rating so you can access the COMMENTS to let me know if it worked out.
I'm far more interested in knowing if it helped than in the rating system.