cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

report export pdf with visual basic macro example

murathoca
MEGA Partner
MEGA Partner

hello I want to export a report created in hopex with a macro. Is there an example simple code?

With to visual basic macro for PPM Module Report To Export File Pdf Example macro

8 Replies

How can I add the marked place in the picture to the macro above.

I am not giving the latest updated report. I need to click on the actions button. how can I add this to the macro you sent me.

thank you very much

Yes, the report is regenerated and contains fresh data

screenshot is attached below

Firstly, thank you. code worked 🙂 how to add new refresh field in this marked area to this code. Or does this code automatically take the current report?

 

oguimard
Retired

Here is an example of script 

 

Dim oRoot,oAnalysisPlugin,oAnalysis,sFile

  Dim oSource : Set oSource = getObjectFromId("MyReportID")

                Set oRoot = GetRoot

                Set oAnalysisPlugin = oRoot.CurrentEnvironment.GetMacro("~9MuFp4qmBD40[Analysis Plugin]")

                Set oAnalysis = oAnalysisPlugin.newAnalysisFromMegaInstance(oSource,false)

  oAnalysis.setDestinationFile "C:\Temp\MyFileName.pdf"

                sFile = oAnalysis.Generate("PDF",MySelf,Nothing)

print "OK"