Skip to main content

Here is a snippet of the code, I can open the .dll, however when I try to run the ShellExecuteA is where I get the error, I found this string in the API Guide:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Here is what is in the wb-1-url

           initialize wb-1-url.
SSRS       MOVE "168.93.99.58/.../ReportViewer.asp
SSRS  -         "x?/TEST REPORTS/TEST&rs:Command=Render&VendorNumber
SSRS  -         "Start=001100&VendorNumberEnd=00UY7&rc:Parameters=Collap
SSRS  -         "sed"
SSRS           TO wb-1-url.
           inspect wb-1-url replacing trailing spaces by low-values.

 

       call-ssrs2.

           perform GET-SYSTEM-VARIABLES.


           SET     ENVIRONMENT      "DLL-CONVENTION" TO 1.

           STRING SYSTEM-ROOT      DELIMITED BY LOW-VALUES
                  "shell32.dll"     DELIMITED BY SIZE
                  INTO SYSTEM-ENV.

           CALL    SYSTEM-ENV
                   ON EXCEPTION     GO TO ERR-CALL.

           CALL    "ShellExecuteA"  USING
                   by value 0 size 4
                   by reference "open"
                   by reference
                      WB-1-URL
                   by value 0 size 4
                   by reference "C:\\"
                   by value SW-SHOWALL
                   ON EXCEPTION     GO TO ERR-CALL.
           CANCEL  "shell32.dll".
           EXIT    PROGRAM.

       GET-SYSTEM-VARIABLES.

           ACCEPT TERMINAL-ABILITIES FROM TERMINAL-INFO.

           ACCEPT SYSTEM-INFORMATION FROM SYSTEM-INFO.

      *Make sure we are synchronized with the DLL.

           SET     ENVIRONMENT      "DLL-CONVENTION" TO "WINAPI".

      *Load the DLL that hosts the functions. We terminate here
      *if the load fails, as there is no need to clean up
      *anything at this point of execution.

           INITIALIZE SYSTEM-ENV,
                      SYSTEM-LOCATION,
                      SYSTEM-ROOT,
                      SYSTEM-CALL,
                      SYSTEM-CALL-STATUS.

           ACCEPT SYSTEM-ROOT FROM ENVIRONMENT "WINDOWSDIRLOCATION".

           INSPECT SYSTEM-ROOT REPLACING TRAILING SPACES BY LOW-VALUES.


Here is a snippet of the code, I can open the .dll, however when I try to run the ShellExecuteA is where I get the error, I found this string in the API Guide:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Here is what is in the wb-1-url

           initialize wb-1-url.
SSRS       MOVE "168.93.99.58/.../ReportViewer.asp
SSRS  -         "x?/TEST REPORTS/TEST&rs:Command=Render&VendorNumber
SSRS  -         "Start=001100&VendorNumberEnd=00UY7&rc:Parameters=Collap
SSRS  -         "sed"
SSRS           TO wb-1-url.
           inspect wb-1-url replacing trailing spaces by low-values.

 

       call-ssrs2.

           perform GET-SYSTEM-VARIABLES.


           SET     ENVIRONMENT      "DLL-CONVENTION" TO 1.

           STRING SYSTEM-ROOT      DELIMITED BY LOW-VALUES
                  "shell32.dll"     DELIMITED BY SIZE
                  INTO SYSTEM-ENV.

           CALL    SYSTEM-ENV
                   ON EXCEPTION     GO TO ERR-CALL.

           CALL    "ShellExecuteA"  USING
                   by value 0 size 4
                   by reference "open"
                   by reference
                      WB-1-URL
                   by value 0 size 4
                   by reference "C:\\"
                   by value SW-SHOWALL
                   ON EXCEPTION     GO TO ERR-CALL.
           CANCEL  "shell32.dll".
           EXIT    PROGRAM.

       GET-SYSTEM-VARIABLES.

           ACCEPT TERMINAL-ABILITIES FROM TERMINAL-INFO.

           ACCEPT SYSTEM-INFORMATION FROM SYSTEM-INFO.

      *Make sure we are synchronized with the DLL.

           SET     ENVIRONMENT      "DLL-CONVENTION" TO "WINAPI".

      *Load the DLL that hosts the functions. We terminate here
      *if the load fails, as there is no need to clean up
      *anything at this point of execution.

           INITIALIZE SYSTEM-ENV,
                      SYSTEM-LOCATION,
                      SYSTEM-ROOT,
                      SYSTEM-CALL,
                      SYSTEM-CALL-STATUS.

           ACCEPT SYSTEM-ROOT FROM ENVIRONMENT "WINDOWSDIRLOCATION".

           INSPECT SYSTEM-ROOT REPLACING TRAILING SPACES BY LOW-VALUES.


Not an expert, but if you look at this forum article: community.microfocus.com/.../calling-web-browser-from-thin-client you'll see that the open command needs to be terminated

Here is a snippet of the code, I can open the .dll, however when I try to run the ShellExecuteA is where I get the error, I found this string in the API Guide:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Here is what is in the wb-1-url

           initialize wb-1-url.
SSRS       MOVE "168.93.99.58/.../ReportViewer.asp
SSRS  -         "x?/TEST REPORTS/TEST&rs:Command=Render&VendorNumber
SSRS  -         "Start=001100&VendorNumberEnd=00UY7&rc:Parameters=Collap
SSRS  -         "sed"
SSRS           TO wb-1-url.
           inspect wb-1-url replacing trailing spaces by low-values.

 

       call-ssrs2.

           perform GET-SYSTEM-VARIABLES.


           SET     ENVIRONMENT      "DLL-CONVENTION" TO 1.

           STRING SYSTEM-ROOT      DELIMITED BY LOW-VALUES
                  "shell32.dll"     DELIMITED BY SIZE
                  INTO SYSTEM-ENV.

           CALL    SYSTEM-ENV
                   ON EXCEPTION     GO TO ERR-CALL.

           CALL    "ShellExecuteA"  USING
                   by value 0 size 4
                   by reference "open"
                   by reference
                      WB-1-URL
                   by value 0 size 4
                   by reference "C:\\"
                   by value SW-SHOWALL
                   ON EXCEPTION     GO TO ERR-CALL.
           CANCEL  "shell32.dll".
           EXIT    PROGRAM.

       GET-SYSTEM-VARIABLES.

           ACCEPT TERMINAL-ABILITIES FROM TERMINAL-INFO.

           ACCEPT SYSTEM-INFORMATION FROM SYSTEM-INFO.

      *Make sure we are synchronized with the DLL.

           SET     ENVIRONMENT      "DLL-CONVENTION" TO "WINAPI".

      *Load the DLL that hosts the functions. We terminate here
      *if the load fails, as there is no need to clean up
      *anything at this point of execution.

           INITIALIZE SYSTEM-ENV,
                      SYSTEM-LOCATION,
                      SYSTEM-ROOT,
                      SYSTEM-CALL,
                      SYSTEM-CALL-STATUS.

           ACCEPT SYSTEM-ROOT FROM ENVIRONMENT "WINDOWSDIRLOCATION".

           INSPECT SYSTEM-ROOT REPLACING TRAILING SPACES BY LOW-VALUES.


Thank you, yes this did work, I still have to test out thin client, we now have a means of launching an SSRS report with stored procedures that transforms legacy Cobol reports to elaborate Graphical styled reports.

Here is a snippet of the code, I can open the .dll, however when I try to run the ShellExecuteA is where I get the error, I found this string in the API Guide:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Here is what is in the wb-1-url

           initialize wb-1-url.
SSRS       MOVE "168.93.99.58/.../ReportViewer.asp
SSRS  -         "x?/TEST REPORTS/TEST&rs:Command=Render&VendorNumber
SSRS  -         "Start=001100&VendorNumberEnd=00UY7&rc:Parameters=Collap
SSRS  -         "sed"
SSRS           TO wb-1-url.
           inspect wb-1-url replacing trailing spaces by low-values.

 

       call-ssrs2.

           perform GET-SYSTEM-VARIABLES.


           SET     ENVIRONMENT      "DLL-CONVENTION" TO 1.

           STRING SYSTEM-ROOT      DELIMITED BY LOW-VALUES
                  "shell32.dll"     DELIMITED BY SIZE
                  INTO SYSTEM-ENV.

           CALL    SYSTEM-ENV
                   ON EXCEPTION     GO TO ERR-CALL.

           CALL    "ShellExecuteA"  USING
                   by value 0 size 4
                   by reference "open"
                   by reference
                      WB-1-URL
                   by value 0 size 4
                   by reference "C:\\"
                   by value SW-SHOWALL
                   ON EXCEPTION     GO TO ERR-CALL.
           CANCEL  "shell32.dll".
           EXIT    PROGRAM.

       GET-SYSTEM-VARIABLES.

           ACCEPT TERMINAL-ABILITIES FROM TERMINAL-INFO.

           ACCEPT SYSTEM-INFORMATION FROM SYSTEM-INFO.

      *Make sure we are synchronized with the DLL.

           SET     ENVIRONMENT      "DLL-CONVENTION" TO "WINAPI".

      *Load the DLL that hosts the functions. We terminate here
      *if the load fails, as there is no need to clean up
      *anything at this point of execution.

           INITIALIZE SYSTEM-ENV,
                      SYSTEM-LOCATION,
                      SYSTEM-ROOT,
                      SYSTEM-CALL,
                      SYSTEM-CALL-STATUS.

           ACCEPT SYSTEM-ROOT FROM ENVIRONMENT "WINDOWSDIRLOCATION".

           INSPECT SYSTEM-ROOT REPLACING TRAILING SPACES BY LOW-VALUES.


Great, like the forum article, add the @DISPLAY syntax so that the call happens on the client