Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Using a hyperlink, can I pass a value from a report to an external program?

I want to call an external program from a report using a hyperlink where the hyperlink needs to take a value from the report, a customer number. This customer number will be sent to the hyperlink which will use it to bring up that customer's record for editing. I actually have a batch file instead of an html file, and I want to send the batch file a customer record. The batch file calls an external program which accepts the customer number and brings up the customer's record for editing in a windows form. I don't have to use a batch file. I could use a link to an html file so long as I can pass the html file the customer number.

Thank you for your help.

Former Member
Former Member replied

I believe I solved my own problem. Below are the steps.

1) From the database table in the Crystal report, I placed a field onto the report.

2) I right clicked on the field and click "format object."

3) In the "Hyperlink" tab I select "A File". In the "hyperlink information:" I clicked the formula button, "x-2." In the formula I entered the below code. You can see, in the below code, I call a bat program which accepts a value. This value is sent by the bat file to an external program using a command string "programname.exe value". The external program takes the value (which originated from the report), looks up the record in a database table and populates a form containing textboxes which display the values from the record. Now, the user can edit the records values from an external program, a windows form, after the user clicks the customer number on the Crystal report. Notice below that the command string is executed after it is declared. It is executed by just typing str on the line immediately after the string declaration.

stringVar str := "C:\ACAPPS\tasks\TestArg.bat " + {DUPLICATEPOLICIES_NOTES.CustomerNum};


Below are the bat file contents.

"C:\Users\chrisk\AppData\Local\Temporary Projects\AppTest\bin\Debug\AppTest.exe" %1

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question