Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Viewing in qv pdf content from the blob

Hello, all

I have a table in oracle 10g db with the blob field.

error loading image

PDF files stored in it

Can i open PDF files in QV?

I see in RefMan "QlikView supports jpg, png, bmp, pdf and rtf blobs"

What mean word "supports"?

1 Solution

Accepted Solutions
Bjorn_Wedbratt
Former Employee
Former Employee

Are you going to host the solution on a QVS or is it stand-alone QV only?
If it is on a QVS the easiest way would be to not load the blob into the qv-file in the first place (there's really no need to have it in the qv-file), but instead have a unique ID for each document read into QV. Then you can create dynamic URL:s in QV using the ID for a document, like:
http://server/getdoc.asp?documentid=001

getdoc.asp in this case will fetch the blob from the DB using the documentid and return the binary result correctly formated (with correct content type etc) back to the browser, which will trigger for example acrobat reader to open the pdf-file. Use ADODB.Stream or similar to stream the content back.

If we're talking stand-alone qv-docs you can do the same if the end-user can access the web server. If not, you need to store the blob inside the qv-doc, write a macro using ADODB.Stream and save the file as a temporary file on the machine. Then you can utilze Launch to open the previously saved file:
set app = ActiveDocument.GetApplication
app.Launch "C:\Program files\Internet Explorer\iexplore.exe" "C:\temp\mytemppdf.pdf"

Might be other ways of doing it so you don't have to save the document to disk, but not sure if you can using vbscript in a macro.

View solution in original post

7 Replies
suniljain
Master
Master

"QlikView supports jpg, png, bmp, pdf and rtf blobs" Means that You can create jpg,png,bmp,pdf from qvw application but not vice-versa.

Not applicable
Author

It is possible to open PDF file in qvw file?

I mean:

1. The user select one record from table

2. Then press some button

3. File prince.pdf (from oracle blob field) open in AcrobatReader.

Not applicable
Author

Hi lexander,

As user selects any file from the pivot table in qlikview. You can assign the file to variable like vFileName = Only(FILE_NAME) and create one button and add action or macro to open executeable for this variable.

It will work but in this case, first of all user has to select any one file before pressing on button. (it is alternative but not solution).

Regards,

Raj Kishor

Not applicable
Author

FILE_NAME? Its cool, but we need PDF file from blob field FILE_BLOB

How we take file from blob to QlikView application?

More details, please

Bjorn_Wedbratt
Former Employee
Former Employee

Are you going to host the solution on a QVS or is it stand-alone QV only?
If it is on a QVS the easiest way would be to not load the blob into the qv-file in the first place (there's really no need to have it in the qv-file), but instead have a unique ID for each document read into QV. Then you can create dynamic URL:s in QV using the ID for a document, like:
http://server/getdoc.asp?documentid=001

getdoc.asp in this case will fetch the blob from the DB using the documentid and return the binary result correctly formated (with correct content type etc) back to the browser, which will trigger for example acrobat reader to open the pdf-file. Use ADODB.Stream or similar to stream the content back.

If we're talking stand-alone qv-docs you can do the same if the end-user can access the web server. If not, you need to store the blob inside the qv-doc, write a macro using ADODB.Stream and save the file as a temporary file on the machine. Then you can utilze Launch to open the previously saved file:
set app = ActiveDocument.GetApplication
app.Launch "C:\Program files\Internet Explorer\iexplore.exe" "C:\temp\mytemppdf.pdf"

Might be other ways of doing it so you don't have to save the document to disk, but not sure if you can using vbscript in a macro.

Not applicable
Author

Thanks, Bjorn

I'm gonna to use QVS

I'll try your advice

Bjorn_Wedbratt
Former Employee
Former Employee

Found a really old example asp-page which might be useful to get you started (there are more efficient ways of doing this if you're into .NET instead of "old asp"):


<%
ID = 1 'blob_id to retrieve from DB, can be fetched from the query-string when calling the page
BlockSize = 4096 'size of chunks to read
Response.ContentType = "image/JPEG" 'type
Set ADOConn = Server.CreateObject("ADODB.Connection")
ADOConn.Open "FILE NAME=c:\test.udl"
strQuery = "SELECT * FROM BinaryObject WHERE blob_id = " & ID
Set oRS = ADOConn.Execute(strQuery)
oRS.MoveFirst
Set Field = oRS("blob_object")
FileLength = Field.ActualSize
NumBlocks = FileLength \ BlockSize
LeftOver = FileLength Mod BlockSize
Response.BinaryWrite Field.GetChunk(LeftOver)
For intLoop = 1 To NumBlocks
Response.BinaryWrite Field.GetChunk(BlockSize)
Next
oRS.Close
ADOConn.Close
Set oRS = Nothing
Set ADOConn = Nothing
%>