Focal Point
[Technique] Question: How to Render PDF Stored within an Oracle BLOB Field?

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

April 29, 2015, 12:22 PM
David Briars
[Technique] Question: How to Render PDF Stored within an Oracle BLOB Field?
I've reviewed the documentation, and see that WebFOCUS supports images (GIF/JPEG formats) stored in Oracle BLOB fields.

In my Oracle BLOB field I have a PDF document stored.

I couldn't find any documentation on this, nor any FocalPoint posts.

Thought I'd check to see if I missed a doc, or if anyone has any suggestions.

My basic requirement is to have the PDF (contents of the BLOB column) available from my WF report (could be link/embedded/iframe...).

In thinking about this, I can't quite wrap my mind around how to pull the Oracle BLOB contents (the column for one given row) into my WF web application.

This message has been edited. Last edited by: David Briars,




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
April 29, 2015, 03:30 PM
eric.woerle
I don't have any good suggestions for you, and I can't think of any style sheet commands that would make a file accessible from a blob.... The best that I can think of, is if you could some how extract the PDF from the blob and save it to the server. then you could put a direct call to the file. But again, I don't think SQL pass thru would work for this as SQL OUT is a table format, not a file format. This might be something you will need to open a Case / NFR for...


Eric Woerle
8.1.05M Gen 913- Reporting Server Unix
8.1.05 Client Unix
Oracle 11.2.0.2
May 04, 2015, 09:40 AM
David Briars
I've opened a case with IB on this question.

The HelpDesk has reported back that they have seen this requirement before, and have provided a solution in these cases.

They will be getting back to me with the solution soon.

I will plan to update this thread accordingly.

This message has been edited. Last edited by: David Briars,
May 04, 2015, 11:03 AM
Wep5622
Our solution was to write a tomcat servlet to retrieve those BLOB's. That way you can drilldown to them using an URL-reference in your report with the necessary BLOB-id's automatically substituted.

It would be nice if IBI provided something like that though.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
May 04, 2015, 11:29 AM
David Briars
That is great that you developed a tomcat servlet to retrieve the BLOB formatted data. (For various reasons, we wouldn't be able to do this at our site.)

Thank you Eric and Wep for your thoughts and comments.

This message has been edited. Last edited by: David Briars,
June 10, 2015, 12:43 PM
David Briars
Following up...

We came up with a technique that we published to the 'Tips and Techniques' site:
http://www.informationbuilders...ocus-web-application




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster
June 11, 2015, 05:59 AM
Wep5622
That's possibly a bit easier than writing a Java servlet :P

Interesting that a TABLE FILE on a BLOB field downloads the BLOB to the FOCCACHE while it displays the file-name! I did not expect that. Good to know.


Now, your solution still won't work for our specific case (although it comes pretty darn close): In our case the stored BLOBs can be all kinds of files (PDF, Word documents, Excel sheets, JPEG and TIFF images, ZIP-files, etc.) and they're stored in the database without a hint of the file-type. It's a mess!

Lucky for us, the Java servlet API is capable of determining the MIME-type from the file(-name), which we then pass on to the HTTP-response header and everyone is happy.

I don't see a way to do that with WebFOCUS, that would be nice to add if possible.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :