Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, All,
Situation:
1. Installed QlikviewPDF.
2. Macro script to print to PDF with predefined output path is working when manually click 'reload' in the Qlikview
3. when batch the qvw script with 'qv.exe /r file.qvw', it either shows windows execution error or nothing.
Can anybody help?
The pdf print script is attached:
----------------------------------------
sub ExportPDFs
printReportPDF("c:\file.pdf")
ActiveDocument.PrintReport "RP01", "QlikViewPDF", false
end sub
Function printReportPDF(pdfPath)
set WSHShell = CreateObject("WScript.Shell")
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfPath, "REG_SZ"
WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"
set WSHShell = nothing
end Function
----------------------------------------
i tell u one trick copy this file with different name.
then add one macro in ur script which will be based on time e.g
sub test
if time = 8:00 A.M.
then
call macro pdf
end if.
then put test macro on open.
and then reload this application through batch file,whenver u want to take out pdf scehedule it on that time.
I think you'll need to add the /NoSecurity switch to your command line:
'qv.exe /r /NoSecurity file.qvw'
-Rob
BTW, i am using Qlikview 8.2 and MS Windows Pro SP2.
i tell u one trick copy this file with different name.
then add one macro in ur script which will be based on time e.g
sub test
if time = 8:00 A.M.
then
call macro pdf
end if.
then put test macro on open.
and then reload this application through batch file,whenver u want to take out pdf scehedule it on that time.
Hi, Anwar
Thank you for the suggestion.
Understand that i can do as you suggested:
*. put the PDF generation at the onOpen trigger with a test condition.
1. reload the data i needed first
2. reload 2nd time and trigger the onOpen trigger then the pdf will be printed.
Tested and this suggestion is working.
However, is there any better ways?
Thank you
Best Regards
Mingming
I have tried out the solution one more time.
Just noticed that i am not able to print multiple PDF in one function.
It will keep overwriting the same file specified for the first time print.
there is pblm in ur pdf function.can u do same work manually..u shld delete previously created file..
Hi, Anwar,
Thanks a lot.
Double checked my code.
It is my code problem. for debug, i commented out the pdf Function Part.
It is working for multiple PDF.