Naomil,
Just curious on 2 things:
i) what made you decide to comment on a message by Colin form 2004 today?
ii) why do you use BLOB fields - they are a p.i.t.a. better store your pictures somewhere and call them, to avoid a) BLOB and b) table becoming too big.
Regards,
Koen
>>Tony -
>>
>>>> How to print blob field that contain image?
>>
>>Here's how Lisa demonstrated printing a BLOB field in a report using the new reporting system in VFP9 in her DevCon sessions:
>>
>>First, some setup:
>>
>> SET REPORTBEHAVIOR 90
>> CREATE CURSOR test ( picname C(25), picdata W)
>> APPEND BLANK
>> REPLACE picname WITH "One", picdata WITH FILETOSTR(GETFILE())
>> APPEND BLANK
>> REPLACE picname WITH "Two", picdata WITH FILETOSTR(GETFILE())
>> APPEND BLANK
>> REPLACE picname WITH "Three", picdata WITH FILETOSTR(GETFILE())
>>
>>
>>Obviously, choose a different GIF, JPG, or BMP file each time.
>>Now, to print the blob contents:
>>
>>Create an in-scope reference to an image control:
>>
>> Image1 = CREATEOBJECT("Image")
>>
>>
>>Create a report form
>>Add a Picture/OLE Bound report element to the Detail band
>>Set the Control Source Type to
Expression or Variable name>>Enter
Image1 as the Control Source.
>>Double-click (or right-click) on the Detail band to get the properties dialog
>>Select the General Tab.
>>Enter an On-Entry Run Expression of:
>>
>> EXECSCRIPT("Image1.PictureVal = test.picdata")
>>
>>Preview the report.
>>
>>Lisa showed how you can scope the Image control to the report by creating it as a member of the report's data environment object, in the BeforeOpenTables event.
>>You can also set the Image1.PictureVal property in a Reportlistener's .BeforeBand() event, but that requires a customised report listener instance.
>>
>>I hope this helps,
>>- Colin
>
>Very nice, thanks for this tip - it worked.
>
>Actually, it worked in VFP IDE, but didn't work in our application. I also re-tested, and it only works for preview, but not with exporting to CutePDF driver.