on 08-08-2016 7:58 AM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.