Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi. i would like to put multiple reports into a file .pdf
Sub printRP01
Set reps = ActiveDocument.GetDocReports
For i = 0 to reps.Count - 1
Set rep = reps.Item(i)
ActiveDocument.PrintReport rep.id
Next
End Sub
'===========================================================================
sub printRP02
printReportPDF "C:\Temp\18T.pdf"
ActiveDocument.GetApplication.Sleep 2000
ActiveDocument.PrintReport "RP01", "QlikviewPDF"
ActiveDocument.SaveAs strRepPath & "teste" & i, 0
ActiveDocument.GetApplication.Sleep 10000
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
'====================================
The problem is:
I dont know why, but the pop up window appears, and i dont like.
and the second and must important this code add 3 .pdf files. But i need the 3 .pdf in one unique file
Hi,
Popup window is actually the sign of progress.
regarding 3 pdf files
you are calling the ActiveDocument.PrintReport in a loop and i guess you have 3 reports thus, loop occurs for 3 times and it creates 3 separate pdf files.
you need to add these into same report and just call this ActiveDocument.PrintReport once.
ex:
if you have 6 charts in 3 reports ie 2 charts in one report then 3 pdf will be generated, append charts in same report in next sheet to get one pdf.
Regards,
Shubhu
Hi shubhu