Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Open pdf documents from Qlikview

I have a task to open pdf documents after selecting Files in selection lists and button click. But the real hassle is they are on different server. Any ideas how to crack this?

3 Replies
Anonymous
Not applicable
Author

I did a similar thing using Excel documents. I accomplished this by:

  1. Include the full path and filename as a field in the load script. I named this field "Filename". If you change the name you will need to change the script.
  2. Drop the Filename field in a list box on my form (not necessary, but nice to see what files will be opened).
  3. Add a button on the form.

    • Set the button action to Run Macro.
    • Click Edit Module.
    • Paste in the following code:

Sub LaunchFile()
'Launch the file
set val=ActiveDocument.Fields("Filename").GetPossibleValues

'make sure not opening too many documents
x = vbOK
if val.count > 5 then
x=msgbox("Opening many documents can take a long time. Do you wish to open " & val.Count-1 & " documents?", vbOkCancel, "Confirm open")
end if

'if ok to launch
if x = vbOk then
for i=0 to val.Count-1
run val.Item(i).Text
next
end if
End Sub

Sub Run(ByVal sFile)
Dim shell
Set shell = CreateObject("WScript.Shell")
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub

    • I clicked the module security to System Access and Allow System Access.
    • Click Check and then click OK.
    • In the Actions tab set the Macro Name to LaunchFile.
    • Click OK.

You should be able to filter for a few files, and then click the button to launch them. The system will launch the PDF file with the application that is associated with PDF files. I hope this helps!

Not applicable
Author

Thank you. will try that. does this work to open files in different server?

Anonymous
Not applicable
Author

Yes. You just need to include the full path to the file. That's what I'm doing with my Excel files. Your path should look something like either of these:

\\server\share\folder\file.pdf

or

z:\folder\file.pdf