Hi Placide,
I'm not sure that this will help you, but I recently coded a similar situation and it worked fine for me. The code I used is
SELECTBLOB image_blob INTO :lblb_pic FROM image
WHERE image.image_code = :ls_image_code;
// Create a file using the image blob, to create the picture.
ll_FileNo = FileOpen(asv_file_path + 'temp.bmp', StreamMode!, Write!, LockReadWrite!, Replace!)
if ll_FileNo < 0 then
<error processing>
end if
if FileWriteEx(ll_FileNo, lblb_pic) = -1 then
<error processing>
end if
// Save the file.
FileClose(ll_FileNo)
// Point the logo picture control to the image file that was created above.
ls_Modstring += " logo_p.filename='" + asv_file_path + "temp.bmp'"
adsr_receipt.Modify(ls_ModString)
The only real differences I can see from your code are
- the Replace parameter in my FileOpen call has a ! on the end, but I assume that's just an omission in the code you posted, cos it wouldn't compile otherwise.
- I'm using modify instead of dot notation to assign the picture control's filename. I doubt this is the problem but maybe something to experiment with anyway?
- I'm doing it on a datastore and not a DW but doubt this matters either.
- And of course, the FileClose statement which wasn't included in your original code snippet but which you said you've now added.
As mentioned by Arnd, have you checked the DW has a row? Not sure what else to suggest because this code works for me using PB 10.2