Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Re : Macro to generate PDF

Dear All,

Anyone please help me to fix the following issue:

i used to generate pdf reports through macro and it was running successfully. and it was triggered post reload. when i go to report--> print reports the pdf generation is happening using PDF exchange 3.0. But automation of PDf report generation by using QlikViewPDF is not working through Macro after the reload.

I checked devices and printer in control panel, there is no queue of tasks that is empty.

Whenever macro is running it is showing printing report in QlikViewPDF printer then application hangs.

kindly help me to fix the issue.

4 Replies
avinashelite

can you please share the macro code ?? check whether QlikViewPDF is installed and working properly

Not applicable
Author

yes..when i do manually through Report->(ReportName)-->Print,  i am able to do Generate the PDF Report.

avinashelite

I think the issue is with the Macro code ....check with that once ??

it should be something like this

Sub GWP_Macro4r_Email

'...........PDF Export logic.............QlikViewPDF

ActiveDocument.clearall
path="\\inmchn24\ChannelMIS\Centrlal MiS\Daily Reports\Automated Reports\"
'path="D:\Qlikview\Report\"
ActiveDocument.PrintDocReport ("RP01"),"QlikViewPDF", false
set rep = ActiveDocument.GetReport("RP01")
reportFile = path & "SRO_GWP_Dashboard"&".pdf"
printReportPDF(reportFile)

ActiveDocument.GetApplication.Sleep 16000

End Sub

Function printReportPDF(pdfOutputFile)

Set WSHShell = CreateObject("WScript.Shell")

WSHShell.RegWrite "HKCU\Software\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"

WSHShell.RegWrite "HKCU\Software\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"

Set WSHShell = nothing

End function

Not applicable
Author

Dear Avinash,

The macro is working fine for more than a year the application is functioning and generating the report with the same macro code.

but suddenly one day it stopped working and manually the report can be generated.