Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to print image from a blob field
Message
De
09/03/2012 05:21:28
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro Beta
Divers
Thread ID:
00962468
Message ID:
01537705
Vues:
85
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   && this needs new-style report engine 
>> 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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform