Focal Point
[CLOSED]Reading Binary Data

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

May 12, 2016, 01:39 PM
RaviD
[CLOSED]Reading Binary Data
All,

We have a blob column in the table where storing large volume of data in a binary format. Now I have to read that data and present in web focus report.
Can anyone suggest me how to read and convert that data into regular readable format?
Any help will be appreciated

Thanks!

This message has been edited. Last edited by: <Emily McAllister>,


WebFocus 8202M
APP Studio
Info assist
Report caster
Portals
Maintain
EXcel,PDF,HTML,Active Reports
May 12, 2016, 02:29 PM
BabakNYC
I've never tried to do this but there is a section in the doc that talks about this subject. Search for BLOB in http://infocenter.informationb...om/wf81rel/index.jsp

How to Add an Image From a BLOB Field to a PDF, DHTML, or HTML Report

For PDF, HTML, and DHTML output against data sources that support the Binary Large Object (BLOB) data 
type (Microsoft SQL Server, DB2, Oracle, Informix, and PostgreSQL using its BYTEA data type), an image 
can be stored in a BLOB field in the data source.

WebFOCUS StyleSheets used to produce report output in PDF, HTML, or DHTML format can access a BLOB field 
as an image source when an instance of the BLOB field contains an exact binary copy of a GIF or JPG 
image. HTML and DHTML reports also support PNG images. Images of different formats (GIF, JPG, PNG) can be 
mixed within the same BLOB field. WebFOCUS can determine the format from the header of the image. The image 
can be inserted in report columns, headings, footings, subheadings, and subfootings.

The BLOB field must be referenced in a PRINT or LIST command in the request (aggregation is not supported). 
Reports containing BLOB images are supported as components in Coordinated Compound Reports.

With the following SET commands, BLOB images will work for both HTML and DHTML in all browsers:

    SET HTMLEMBEDIMG=AUTO.
    SET HTMLARCHIVE=ON (required to support Internet Explorer with images larger than 32K).
    SET BASEURL='' (required to make embedded images work as it overrides the default setting sent from the WebFOCUS Client).
    SET HTMLCSS=ON (required for image positioning in subheads in HTML reports). Setting HTMLCSS=ON creates an HTML report 
                    with an Internal cascading style sheet. A report with an Internal cascading style sheet is an HTML page 
                    with an HTML cascading style sheet (CSS) stored between the style tags within the HTML document.



WebFOCUS 8206, Unix, Windows
May 12, 2016, 02:43 PM
RaviD
Thanks for the quick reply. This is not an Image, storing large volume of data in binary format. We need to retrieve the data and display in the report.
This document did not mentioned anything about binary data.


WebFocus 8202M
APP Studio
Info assist
Report caster
Portals
Maintain
EXcel,PDF,HTML,Active Reports
May 12, 2016, 02:58 PM
Ricardo Augusto
Ravid, what happens when you PRINT this blob column?


WebFOCUS 8.1.05 / APP Studio
May 12, 2016, 03:38 PM
BabakNYC
What's the DBMS? Could you show us the DDL for the table in the database and show us the FIELDNAME= line for this particular BLOB field in the table's master file? I'm not sure if you can just PRINT a binary large object in a TABLE request.


WebFOCUS 8206, Unix, Windows
May 12, 2016, 05:10 PM
RaviD
Here the Sample Data is coming from Table Request:

TABLE FILE VMS_FILE_TBL_TEMP
PRINT FILE_CONTENT
WHERE FILE_ID = 39
END

FILE_CONTENT
2016-05-12-01-00-20t000078s000001bin

Master File:
FILENAME=VMS_FILE_TBL_TEMP, SUFFIX=SQLORA , $
SEGMENT=VMS_FILE_TBL_TEMP, SEGTYPE=S0, $
FIELDNAME=FILE_ID, ALIAS=FILE_ID, USAGE=I11, ACTUAL=I4, $
FIELDNAME=INV_FILE_ID, ALIAS=INV_FILE_ID, USAGE=I11, ACTUAL=I4, $
FIELDNAME=PARTNER_CODE, ALIAS=PARTNER_CODE, USAGE=A40V, ACTUAL=A40V, $
FIELDNAME=CUSTOMER_CODE, ALIAS=CUSTOMER_CODE, USAGE=A60V, ACTUAL=A60V, $
FIELDNAME=SOURCE_SYSTEM_CODE, ALIAS=SOURCE_SYSTEM_CODE, USAGE=A40V, ACTUAL=A40V, $
FIELDNAME=SOURCE_FILE_NAME, ALIAS=SOURCE_FILE_NAME, USAGE=A1016V, ACTUAL=A1016V, $
FIELDNAME=FILE_TYPE, ALIAS=FILE_TYPE, USAGE=A40V, ACTUAL=A40V, $
FIELDNAME=FILE_SIZE, ALIAS=FILE_SIZE, USAGE=A40V, ACTUAL=A40V, $
FIELDNAME=FILE_CONTENT, ALIAS=FILE_CONTENT, USAGE=BLOB, ACTUAL=BLOB, $
FIELDNAME=STATUS_CODE, ALIAS=STATUS_CODE, USAGE=A40V, ACTUAL=A40V, $
FIELDNAME=CREATE_DATE, ALIAS=CREATE_DATE, USAGE=HYYMDS, ACTUAL=HYYMDS, $
FIELDNAME=UPDATE_DATE, ALIAS=UPDATE_DATE, USAGE=HYYMDS, ACTUAL=HYYMDS, $
FIELDNAME=UPDATEBY, ALIAS=UPDATEBY, USAGE=A120V, ACTUAL=A120V, $


WebFocus 8202M
APP Studio
Info assist
Report caster
Portals
Maintain
EXcel,PDF,HTML,Active Reports
May 12, 2016, 06:16 PM
BabakNYC
It looks like a string. The left most seems to be just a date. So, are you trying to chop up the field into separate segments? I wonder if you could create a DEFINE and see if you can populate an A100 field with it. Something like NEW_CONTENT/A100=FILE_CONTENT; If it doesn't give you an error, then you should be able to use Text Functions to substring it to whatever segments make sense.


WebFOCUS 8206, Unix, Windows
May 17, 2016, 11:25 AM
RaviD
I found some information in IB website, I need to test.

https://www.informationbuilder...ocus-web-application


WebFocus 8202M
APP Studio
Info assist
Report caster
Portals
Maintain
EXcel,PDF,HTML,Active Reports