cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable the “Confirmation” dialog when generating reports using script in PowerDesigner

Former Member
0 Kudos

I have a script to generate report which is invoked from the command line: "C:\Program Files\SAP\PowerDesigner 16\PdShell16.exe" -X pd-gen-reports.vbs

The report.GenerateHtml function shows a dialog with prompt "Do you want to open it with the default application now" after successfully generating the HTML report and I have to manually click the "No" button.

Is there a way to disable this dialog so the script can be executed in automated build process without human interactions?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello,

I suggest you to play a bit with different interactive modes. Try some combination of batch and abort modes. Here is how you set it up:

InteractiveMode = im_Batch

More details in standard PD documentation.

It migh happen, that it won`t be possible to make PD bahave exactly according to your needs. Then I recommned to let it open and then close it "manually" as a next command in your VB script.

Regards,

Ondrej

Former Member
0 Kudos

Thanks for your reply.

Unfortunately, neither InteractiveMode = im_Batch nor im_Abort works. The "dialog" still shown.

Here is my script file:

Option Explicit

InteractiveMode = im_Abort 'im_Batch

Dim workspace

Set workspace = ActiveWorkspace

workspace.Load("teamwork.sws")

Dim wsItem

For Each wsItem In workspace.children

   If wsItem.IsKindOf(PdWsp.cls_WorkspaceModel) Then

      Dim model

      Set model = wsItem.Open()

      GenerateAllReportsInModel(model)

      model.Close()

      Set model = Nothing

   End If

Next

workspace.Close()

'===================================================

' Sub Routines

'===================================================

Sub GenerateAllReportsInModel(modelItem)

   output "Processing model " & modelItem.FileName

  

   Dim reportItem

   For Each reportItem in modelItem.Reports

      GenerateReportHtml(reportItem)

   Next

  

   output "Finished processing model " & modelItem.FileName

   output "----------------------------------------"

   output ""

End Sub

sub GenerateReportHtml(reportItem)

   Dim reportDir

   reportDir = ".\reports\"

  

   Dim reportPathName

   reportPathName = reportDir & reportItem.Name & ".html"

  

   output "Generating report " & reportPathName & " ..."

   reportItem.GenerateHtml(reportPathName)

   output "Report " & reportPathName & " is generated."

end sub

Former Member
0 Kudos

Hi,

that is strange. What version of PD are you using? I tested both your code and also my own code (see below) and I was able to generate the reports in both cases without any confirmation windows. My PD version is 16.5.5. Can you test my simple script? And can you test it on different machine?

interactivemode = im_Batch

For each reportItem in Activemodel.Reports

  output "Generating report " & reportPathName & " ..."

  reportItem.GenerateHtml("C:\temp\" + reportItem.Name + ".html")

  output "Report " & reportPathName & " is generated."

Next

Ondrej

Former Member
0 Kudos

Thanks you for your help ^_^

My PD version is 16.5.4.1 (4535), and PD is running in

Your little script shows the confirmation dialog too.

Sorry I can not test it on different machine, may be some days later ....