Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

create pdf with macro

hi i am trying to create a pdf with a macro. I am using qv11 and wlikviewPDF.

the code should be alright cause Im not getting any errors but i can see the pdf on the desktop of my computer.

here is the code. can someone explain me what I am doing wrong?

sub report

    ActiveDocument.clearall

    path="C:\Users\p0862\Desktop\"

    'path="D:\Qlikview\Report\"

    ActiveDocument.PrintDocReport ("RP01"),"QlikViewPDF", false

    set rep = ActiveDocument.GetReport("RP01")

    reportFile = path & "versuch.pdf"

    printReportPDF(reportFile)

   

    ActiveDocument.GetApplication.Sleep 16000

End Sub

Function printReportPDF(pdfOutputFile)

    Set WSHShell = CreateObject("WScript.Shell")

    WSHShell.RegWrite "HKCU\Program Files (x86)\QlikView\QlikViewPDF\OutputFile", pdfOutputFile, "REG_SZ"   

    WSHShell.RegWrite "HKCU\Program Files (x86)\QlikView\QlikViewPDF\BypassSaveAs", "1", "REG_SZ"   

    Set WSHShell = nothing

End function

"HKCU\Program Files (x86)\QlikView\QlikViewPDF\OutputFile" is this link correct? cause I have it from the community and I dont know what I should really use here? and what is HKCU? and in my folder QlikViewPDF I cant see no file or folder that is named outputfile or bypasssaveas. I am new on creating a pdf thats why I have all this questions.

regards,

MT

3 Replies
Not applicable
Author

please help I just dont know what I'm doing wrong?

jerrysvensson
Partner - Specialist II
Partner - Specialist II

Not applicable
Author

i found some codes about creat pdf in vb.net for you:

Dim pdf As New RasterEdgePdfCreator()

Dim xml As New RasterEdgeXmlDocument()

Dim xslt As New RasterEdgeXmlDocument()

xml.Load(@"C/1.xml")

xslt.Load(@"C:/1.xslt")

doc.BindFO(xml, xslt)

doc.IsTruetypeFontMapCached = true

doc.TruetypeFontMapPath = (@"d:/pdf/")

doc.Save(@C:/"T.pdf", SaveType.OpenInAcrobat,Response)