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

about print qv-report to pdf with macro

hi guys.

im trying to print a qv-report to pdf with macro.

here a code i found from people post.

actually,they almost same.

Sub Dagrapport
vReport = "QVreportname" 'Set report
vName = "reportname" 'Name of output pdf
ActiveDocument.PrintReport(vReport), "Bullzip PDF Printer", false 'Printreport
reportFile = "reportpath" & vName &".pdf" 'Setting outputname
MyPrintPDFWithBullZip(reportFile) 'Call pdf printer
ActiveDocument.GetApplication.Sleep 5000
zendDagrapport
End sub

when i run this code, the script stop at ActiveDocument.PrintReport(vReport), "Bullzip PDF Printer", false 'Printreport

its just stop at this line any code i found. and no error info back to me.

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

32 bit machine

GhostScript , version is 9.0

BullzipPDF , version is 8.2(i guess....)

had installed the http://ftp.qliktech.com/QvWebDownloads/Release8/QvPDFSetup.exe

and set the system access to allow any macros.

Anyone got any ideas?

Thanks for your help !

10 Replies
Not applicable
Author

Hi, Can't really comment as to what exactly the error is but just want to ask that for publishing pdf reports in QV we need to have qv pdf writer installed... again set the system access to allow any macros and meanwhile try out some other scripting also which can be found on qv community itself.. Kindly share the solution also.... Regards Gaurav

Not applicable
Author

you mean installed this?

http://ftp.qliktech.com/QvWebDownloads/Release8/QvPDFSetup.exe

yes, i installed already and set the system access to allow any macros.

RSvebeck
Specialist
Specialist

Hi.

I have written a small paper on this subject, but it is in Swedish. I will translate it into english and post it to this thread.

Best Regards Robert

Svebeck Consulting AB
Not applicable
Author

Omg, thanks so much. 

RSvebeck
Specialist
Specialist

Hi. Here it comes. Pardon the bad english, I just made a quck transaltion.... //Robert

Svebeck Consulting AB
Not applicable
Author

hi Robert Svebeck

thank you ,thanks for your pdf

i had learn more  from ur pdf, but that problems till there......

will more try on my own PC, too much restrict on company PC .........i guess

RSvebeck
Specialist
Specialist

Hi.

This blog could perhaps be helpful for you:

http://qliktips.blogspot.dk/2012/02/printing-reports-to-pdf-using.html

Best Regards

Robert

Svebeck Consulting AB
stantrolav
Partner - Creator II
Partner - Creator II

Hi! Mabye there is some mistake in this macro from your PDF:

sub Check_if_send_mail

set var = ActiveDocument.Variables("vMailReports").String

if val = 1 then

call Print_and_mail_Report

ActiveDocument.ClearAll

var.SetContent 0, true

activedocument.closedoc

ActiveDocument.GetApplication.Quit

end if

End Sub

Anonymous
Not applicable
Author

Hi Robert,

Thanks a lot for the explanation. It works fine for me.

Actually I changed the Check_if_send_mail a bit, because I got an error.

The functionality works fine, I have only one problem left. When I open the QV document in Accesspoint I get this error: Macro parse failed. Functionality was lost.

OnOpenDocument

Error: Types doesn't match '[string. ''']'

Version installed: 11.2 SR3.

I hope you can help me on this.

Kind regards,

Henco