Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Report printing .. BypassSaveAs ... shouldn't this give the correct name to the report?

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

1 Reply
Not applicable
Author

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