Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to save my report with pdf (for later distribution) ...
Finally I got the report saved, but it is saved on the default location with the name "Qlikview Printing.pdf" ..
sub PrintReportAGAIN
Set WSHShell = CreateObject("WScript.Shell")
fln = "C:\Qlikview\Temp\myreport.pdf"
RegKey = "HKEY_CURRENT_USER\Software\QlikViewPDF"
WSHShell.RegWrite RegKey & "BypassSaveAs", 1
WSHShell.RegWrite RegKey & "OutputFile", fln
ActiveDocument.GetApplication.Sleep 2000
ActiveDocument.PrintDocReport "RP01", "QlikViewPDF"
ActiveDocument.GetApplication.Sleep 2000
WSHShell.RegWrite RegKey & "BypassSaveAs", 0
WSHShell.RegWrite RegKey & "OutputFile", ""
Set WSHShell = nothing
end sub
Am I missing something?? ... seems like the BypassSaveAs does not work correctly??
rgrds,
Anita
Hi, I normaly use this code without problems.
Seems the same.
function printReportPDF(pdfOutputFile, reportID)
Set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
ActiveDocument.PrintReport reportID, "QlikViewPDF", False
checkOutputFile(pdfOutputFile)
end function
'====================================================================
function checkOutputFile(pdfFile)
Set fileTest = CreateObject("Scripting.FileSystemObject")
currentStatus = fileTest.FileExists (pdfFile)
if currentStatus = false then
ActiveDocument.GetApplication.Sleep 2000
checkOutputFile(pdfFile)
end if
set fileTest = nothing
end function