Scenario
You wish to trigger a print event of a custom Crystal report when creating a stock transfer document from a beas Web App 2.1.
Process description
1) The project folder associated to the web service needs to be set-up correctly. In this example, we have set the local folder of the beas installation as such:
C:\Program Files (x86)\SAP\SAP Business One Server\B1_SHR\beas software\Project\
When setting the project folder, select the beas service you're using for the web service and assign the correct path:
Please make sure that you set the top level of the project folder: in this example we have set the following path:
C:\Program Files (x86)\SAP\SAP Business One Server\B1_SHR\beas software\Project\
but the system will look into the subfolder
C:\Program Files (x86)\SAP\SAP Business One Server\B1_SHR\beas software\Project\BeAs_Demo_CS_IT_93000025
because it assumes the following path from the database name you have configured here:
2) Make sure that your beas service for the web server is run with an account that has full Administrator authorizations on the machine where you're running the service on. In this example case, the user account used for running the beas service is a domain account THAT HAS BEEN CONFIGURED AS ADMINISTRATOR OF THE LOCAL MACHINE. See image below that shows the user account setting for running the beas service:
3) When the above is correct, create a new stockmanagement.src file that only contains the following lines:
function transferend
sql=SELECT PRINTERNAME into :ls_printername from BEAS_SYS_LOCATION WHERE LOCATION_ID = N'<system.location>'
//your report name
printobject=openreport=Transfer.rpt
//connection opening
printobject=connectioninfo
// set quantity of copies (output)
printobject=setvar=druckcopy=1
//parameters for the report
printobject=setvar=docentry=<e_docentry,#0>
//printobject=setvar=myparam2=<paramvalue2>
printobject=parameter
printobject=parameter_set
// set printer (exact that name, which is defined in the Windows printer definitions)
tools=printer=getdriversport=<ls_printername>
printobject=crreport=selectprinter=<value_printerdriver>=<value_printername>=<value_printerport>
printobject=crreport=printout
end function
Place the file in the project folder as specified on previous steps.
4) Make sure that your crystal report file is connected to the correct database with the beas_sap ODBC default connection we provide. You report connection should look as the following:
5) Try to preview the report directly from Crystal reports builder and make sure that the preview works. It is recommended that at this stage you only have one input parameter for testing (in this case it is DocEntry).
6) Save the report and place it in the same project folder as per previous steps
7) Set the Location for the Web Apps to either Mandatory or Optional. This can be done here:
8) On the beas work station settings wizard, create a location and assign a default printer to it. Then assign the location to the station you're testing from. This can be done here:
9) Restart the beas service so to have all changes you made to be refreshed and active for the next login to the web apps.
You're all ready to go. Now that you will post the next stock transfer from the beas Web App, you will automatically receive the print out of your CR document.
Comments
0 comments
Please sign in to leave a comment.