Execute .exe in SSRS Report

旧时模样 提交于 2020-01-01 07:34:08

问题


i want to execute a .exe in a SSRS Report from Microsoft Dynamics AX.

I tried so far to realize that over Custom Code and a Textfield with following Expression: =Code.StartProcess("test")

Public Function StartProcess(ByVal s As String) As String  
  Dim pHelp As New ProcessStartInfo
  pHelp.FileName = "test.bat"
  pHelp.Arguments = s
  pHelp.UseShellExecute = True
  pHelp.WindowStyle = ProcessWindowStyle.Normal
  Dim proc As Process = Process.Start(pHelp)
  Return "it works"
End Function 

I get the error ":StartProcess is invalid. InvalidIdentifier"

As second try i use this:

="javascript:void(window.open('file://AX2012R2A/Share/batch.exe'))"

in an action expression.

This trial opened in the report the following message by clicking on the image:

My problem is now that I have to pass a parameter to the batch and then it doesn't work.

Have you any idea to help me?


回答1:


I have solved my Problem.

As first step I mentioned, that also simple methods like:

Public Function StartProcess(ByVal s As String) As String   
  Return "it works"
End Function

brought the error: ":StartProcess is invalid. InvalidIdentifier"

As second step i found this link: Link to Google Group discussion (perhabs you have to expand all messages).

As last step i have to create a Datamethod and then call it in an expression and it works. The code in the datamethod isn't in VB.Net but in C#. How this works, can you see here (Youtube)

Thank you all for your help.



来源:https://stackoverflow.com/questions/39577094/execute-exe-in-ssrs-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!