Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to auto export PDF after batch reload?

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

----------------------------------------

1 Solution

Accepted Solutions
Not applicable
Author

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.

View solution in original post

8 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think you'll need to add the /NoSecurity switch to your command line:

'qv.exe /r /NoSecurity file.qvw'

-Rob

Not applicable
Author

Dear Rob,

Thank you for your suggestion. I have tried and failed with error.

I am not sure whether it is due to Application & OS incompatibility?

Thank you.
Best Regards

Mingming

Not applicable
Author

BTW, i am using Qlikview 8.2 and MS Windows Pro SP2.

Not applicable
Author

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.

Not applicable
Author

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

Not applicable
Author

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.

Not applicable
Author

there is pblm in ur pdf function.can u do same work manually..u shld delete previously created file..

Not applicable
Author

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.