Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Print report to PDF.

Hi everyone.

I am trying to save a report after a reload using a macro.

This is working great but the fact that I receive a Save As message each time the macro runs.

I have spend the last hour and a half sifting through the forum trying to find a solution and I have tried several pieces of code but I cannot get rid of this message.

I am using Qlikview 12.10 on a windows 7 64 bit machine.

The PDF printer I am using is CutePDF Writer, and I already tried looking for a specific setting in this tool that enables this popup window, couldn't find any.

The script I am currently using is:

sub printReport

printReportPDF "C:\Download\Test_pdf.pdf"

ActiveDocument.GetApplication.Sleep 2000

ActiveDocument.PrintReport "RP01", "QlikViewPDF",False

ActiveDocument.GetApplication.Sleep 10000

end sub


Function printReportPDF(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

I want to thank you all for your help in advance.

Kind regards,

Mike

3 Replies
Not applicable
Author

No suggestions?

marcus_sommer

Try it this way:

sub printReport

    set doc = ActiveDocument

    report = "RP01"

    call printReportPDF("C:\Download\Test_pdf.pdf", doc, report)

end sub


sub printReportPDF(pdfOutputFile, doc, Report)

    Set WSHShell = CreateObject("WScript.Shell")

    WSHShell.RegWrite "HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows\Device", "QlikViewPDF", "REG_SZ"

    WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
    WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"

    Set WSHShell = nothing

    doc.GetApplication.Sleep 1000

    doc.PrintReport Report, "QlikViewPDF",False

    doc.GetApplication.Sleep 4000

End sub


Here is another example: Re: automatically print report on harddrive printer‌ and it might be also useful to switch to the new printer: Re: generate pdf with Xchange‌ than the QlikViewPDF printer is quite old and worked great with QV 8 but it became a bit unstable within QV 11 and I switched all tasks to PDF XChange.


- Marcus


Not applicable
Author

Thank you for your suggestion, I will try this ASAP.

Kind regards.