Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Printing PDF

Hi

I have looked through the forum and I am close to a resolution on this but I cannot quite get the code right for what I want to do.

I want to be able to run a report for each possible selection in this case company name and name it as the company name.

What I am getting is one file not split by company, but when I run the test in the module I see the selection box flick through all the possible selections.

The code I am using is. The outcome I want is the report run once for each company possible value.

Thanks

Sub pdfprint
UrlPath = "c:\pdftest"
set val=ActiveDocument.Fields("Company_Name").GetPossibleValues
for f=0 to 0

reportName01 = f
reportFile = UrlPath & val.Item(f).Text & ".pdf"
HOLA= PrintReportPDF( "RP01", reportFile)
ActiveDocument.GetApplication.Sleep 5000
next
End Sub
'___________________________________________________________________________________________________________________________________________'
Function PrintReportPDF(oReport, pdfOutputFile)
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 oReport, "QlikViewPDF", false
set WSHShell = nothing
End Function









0 Replies