AnsweredAssumed Answered

How to run "Run Defined Query" Using VBScript

Question asked by karthikeyanarunachalam on Apr 21, 2017
Latest reply on Jun 26, 2018 by guyjj

Hi,

I'm working on output automation . I have able to open the Report writer using VB script but Couldn't able to identify how to run the "Run Defined Query" (We are having few defined query in Report writer) .  Please help to identify how to run the "Run Defined Query" under Query Tab in Report writer.

 

I'm using the below VBscript to open the Report writer .

 

Option Explicit


Sub  Execute_ReportWriter  ()

Dim resultMess
Dim retBool,diaObj,Exiting
Dim butObj, CloseObj

retBool = app.Gui.ProcessCommand("Output->Report Writer",True)
If (retBool = False) Then
Call app.Gui.StatusBarText("HKP Export " + _
                             Err.Description,epcbStatusFieldError)
  Exit Sub
End If

' Find the dialog
Set diaObj = app.Gui.FindDialog("Report Writer")
If (Err Or (diaObj Is Nothing)) Then
  Call app.Gui.StatusBarText("Report Writer Generation not found " + _
                             Err.Description,epcbStatusFieldError)
  Exit Sub
End If

' Find the process button
Set butObj = diaObj.FindButton("OK")
If (butObj Is Nothing) Then
  Call app.Gui.StatusBarText("Report Writer Generation- Process button not found " + _
                             Err.Description,epcbStatusFieldError)
  Exit Sub
End if

End Sub

Dim app
Set app = GetObject(,"MGCPCB.Application")
Call Execute_ReportWriter

Outcomes