Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using the below macro code for pdf generation of Dashboard1.qvw:
Sub PrintReports
'This macro can be used to print pdf reports into the directory structure using bullzip pdf
ActiveDocument.GetApplication.Sleep 2000
ActiveDocument.PrintReport "RP01", "Bullzip PDF Printer"
ActiveDocument.GetApplication.Sleep 10000
MyPrintPDFWithBullZip "C:\Qlikview\Dashboard1.pdf"
ActiveDocument.GetApplication.Sleep 10000
End Sub
FUNCTION MyPrintPDFWithQlikViewPDF (pdfOutputFile)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
END FUNCTION
FUNCTION MyPrintPDFWithBullZip (pdfOutputFile)
'need to init the printername, otherwise the assignment of the values will fail
Set obj_printer_util = CreateObject("Bullzip.PDFUtil")
printername = obj_printer_util.defaultprintername
'init the BullZip preferences object
set obj = CreateObject("Bullzip.PDFSettings") 'For 32Bit System u use PDFPrinterSettings
obj.printername = obj_printer_util.defaultprintername 'assign the printername
obj.SetValue "Output" , pdfOutputFile
obj.SetValue "ConfirmOverwrite", "no"
obj.SetValue "ShowSaveAS", "never"
obj.SetValue "ShowSettings", "never"
obj.SetValue "ShowPDF", "no"
obj.SetValue "RememberLastFileName", "no"
obj.SetValue "RememberLastFolderName", "no"
obj.SetValue "ShowProgressFinished", "no"
obj.SetValue "ShowProgress", "no"
obj.WriteSettings True
END FUNCTION
and pdf file is generated from this.
I used same code for pdf generation of Dashboard2.
just i Change the file name "C:\Qlikview\Dashboard2.pdf"
but when i run the Dashboard2.qvw macro for pdf generation after Dashboard1.qvw then it will create the different file named dashboard2.pdf but having same details/data of dashboard1.pdf or sometimes this happens that dashboard2.pdf is not created and data is updated in dashboard1.qvw.
Anyone face this issue ?
Kindly help to resolve.
HI there
It is a little bit difficult for me to generate pdf files using a code.
There are many third party tool which supports to generate PDF files directly.
So you can try to add some PDF program.Best wishes.
Please refer this post for correct answer: