Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, I've seen many examples for printing reports to PDF. It seams easy but the code doesn't work.
I only need to print one report to PDF and do not have to answer the name neither the path. I'm using that code.
sub printPDF()
tempFolder="c:\TMP"
set rep=ActiveDocument.GetReport("RP01")
reportName=rep.Name
reportFile=tempFolder & reportName & ".pdf"
printReportPDF rep, reportFile
End Sub
function printReportPDF(oReport, pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
Set WSHShell = nothing
End Function
It just don't do anything.
Any ideas, thanks.
Do you have QlikView PDF Writer installed? It's a separate add-on. If you search this forum, you'll see a download link - I remember someone posted it once.
Oleg
Do you have QlikView PDF Writer installed? It's a separate add-on. If you search this forum, you'll see a download link - I remember someone posted it once.
Oleg
If I run your code in DEBUG, I get a message "ActiveX component can't create object: 'WScript.Shell'". This is with Macro security set to safe mode.
If I set Macro security to System Access, it runs and creates 2 keys in the registry. I cannot see how it is supposed to print from there - are you missing a few lines?
e.g. ActiveDocument.PrintReport oReport, "QlikViewPDF", false
... put this before
Set WSHShell = nothing
Link to PDF Writer
http://ftp.qliktech.com/QvWebDownloads/Release8/QvPDFSetup.exe
Thank you, I was trying with CutePDF and it didn't work. But once I installed the QlikViewPDF printer it works.
Best regards.
Just a sidenote..
If I recall correctly changing the reg key paths should make it work with CutePDF also. In other words, changing QlikViewPDF to CutePDF.
Jsn, You can do the same with CutePDF, but you need Custom cutepdf to accept the changes in the registry.
Custom Cute pdf is not for free - I think it cost 500$