Focal Point
[SOLVED] Image stored in a BLOB field on MSSQL server

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6331020932

July 27, 2007, 11:20 AM
Alek_
[SOLVED] Image stored in a BLOB field on MSSQL server
Is there any way in WebFocus to display images stored in a BLOB (IMAGE) field in MS SQL databse? Or convert them into real images on the disk?
Thanks in advance

This message has been edited. Last edited by: FP Mod Chuck,


WF 8.0.6
Windows Server 2003
August 06, 2007, 11:58 AM
Kerry
Hi Alek,

Has this issue been resolved?

I am wondering, can you please provide us a little more details on what you are trying to accomplish?

Also, as always suggested here, can you please update your signature? This way we know the environment you are working on and it will help all to provide constructive suggestions.

Thank you in advance for sharing with all. Smiler

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
August 06, 2007, 12:19 PM
Alek_
Thanks Kerry, I have resolved it by executing a Java application from WebFOCUS procedure which converts a BLOB binary field into an image file on the disk. Then I use a path to the image in my PDF report.


WF 8.0.6
Windows Server 2003
November 08, 2007, 01:17 PM
Richie
Alek,

Can you show me how you were able to execute a JAVA Application?



Thanks
Richard


Web Focus Developer Studio Ver 7.62
Windows XP platform.
mostly dynamically built reports
November 08, 2007, 01:27 PM
Alek_
-SET &CMD= 'java -cp c:\ibi\apps\spread_printout;c:\sqljdbc.jar Connect' | ' ' | &VENDORPRODUCTID | ' ' | &COUNTER | ' ' | 'c:\ibi\apps\spread_printout\';

-DOS &CMD.EVAL


WF 8.0.6
Windows Server 2003
May 08, 2017, 12:35 PM
vaayu
Alek,
I have a very similar requirement to read an Image out of BLOB/IMAGE field from sql server using an ID. Is this the preferred way to read/display the image ? I'm wondering if there's a way to not save but display it in HTM page so we can avoid the multiple images in the app folder, specially if they're confidential/classified.
Thanks in advance.


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
May 08, 2017, 12:59 PM
Frans
I would convert the image first to text and then include this text in the HTML.

Convert:
cast(cast( as binary) as varchar(1000)) as image_text


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
May 09, 2017, 02:37 PM
vaayu
I'm not sure what I'm missing here but its just some special characters and when I use it the report there's really no image


-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************
May 09, 2017, 10:17 PM
David Briars
quote:
...requirement to read an Image out of BLOB/IMAGE field from sql server...

Here is an example running against the Microsoft SQL Server AdventureWorks2014 sample db:
TABLE FILE PRODUCTPHOTO
"Product Photos"
PRINT PRODUCTPHOTOID
      LARGEPHOTO
WHERE PRODUCTPHOTOID EQ 76
-**************************
-* Lines between asterisk lines required for BLOB image support
-* for HTML and DHTML formats.
ON TABLE SET HTMLEMBEDIMG AUTO
ON TABLE SET HTMLARCHIVE ON
ON TABLE SET HTMLCSS ON
-**************************
ON TABLE SET STYLE *
 INCLUDE = endeflt, $
 TYPE=DATA,COLUMN=LARGEPHOTO,IMAGE=(LARGEPHOTO),SIZE=(2 1.5),$
ENDSTYLE
END 

This message has been edited. Last edited by: David Briars,
May 10, 2017, 01:53 PM
vaayu
Thank you David. This helps a lot!

quote:
TABLE FILE PRODUCTPHOTO
"Product Photos"
PRINT PRODUCTPHOTOID
LARGEPHOTO
WHERE PRODUCTPHOTOID EQ 76
-**************************
-* Lines between asterisk lines required for BLOB image support
-* for HTML and DHTML formats.
ON TABLE SET HTMLEMBEDIMG AUTO
ON TABLE SET HTMLARCHIVE ON
ON TABLE SET HTMLCSS ON
-**************************
ON TABLE SET STYLE *
INCLUDE = endeflt, $
TYPE=DATA,COLUMN=LARGEPHOTO,IMAGE=(LARGEPHOTO),SIZE=(2 1.5),$
ENDSTYLE
END



-********************
Sandbox: 8206.10
Dev: 8201M
Prod:8009
-********************