Knowledge Base > Automation Engine and Target Systems > SAP > Using the MBeans Crystal Reports

Using the MBeans Crystal Reports

The MBean "CrystalReports" is supplied with the JMX agent and must be installed.


MBean

Description

Name

UC4:name=CrystalReports

Attribute

"StatusCheckInterval" - Interval in which the report status is checked

Default value: 3 seconds

Operations

"executeAndMail" - Executes a report and sends its output file by mail

Parameter: Report details, report attributes, email receiver

"executeAndSave" - Executes a report and sends its output file

Parameter: Report details, report attributes

Procedure

Two steps are required to execute a report:

  1. Set the parameter for the operation to be called. Use the function JMX_COMPOSITE_ADD because a list of values is expected. The parameter for report specifications contains values such as the Web Service's address and the report name.
  2. Now call the required operation using the function JMX_INVOKE.

The MBean "CrystalReports" is automatically registered by the JMX agent. It is not necessary to call the function JMX_CREATE_MBEAN.

Example

The "Smith" company processes a report about orders made by customer number 55355. The result (Excel sheet) is sent to Mr. Black by e-mail.

The function JMX_COMPOSITE_ADD creates the three parameters "report", "settings" and "mail". Several values are assigned to each of these parameters and subsequently they are assigned to the operation "executeAndMail".

! Report details
JMX_COMPOSITE_ADD NAME="report",KEY="URL",VALUE="http://localhost:5555/dswsbobje2/services"
JMX_COMPOSITE_ADD NAME="report",KEY="REPORT",VALUE="Main_Folder/Customer_List/3000 - SMITH - Sales_Orders"
JMX_COMPOSITE_ADD NAME="report",KEY="FORMAT",VALUE="EXCEL"
JMX_COMPOSITE_ADD NAME="report",KEY="MAIL_SUBJECT",VALUE="Customer Number 55355"
JMX_COMPOSITE_ADD NAME="report",KEY="MAIL_BODY",VALUE="Dear Mr. Black,
Please find enclosed the report for customer number 55355.
It contains all orders made in December.

Best regards
Jack White

JMX_COMPOSITE_ADD NAME="report",KEY="MAIL_FROM",VALUE="white@smith.com"

! Report attributes
JMX_COMPOSITE_ADD NAME="settings",KEY="Customer_number",VALUE="55355"
JMX_COMPOSITE_ADD NAME="settings",KEY="Date_area",VALUE="20061201;20061231"

! Email receiver
JMX_COMPOSITE_ADD NAME="mail",KEY="black@smith.com",VALUE="TO"

! Calling the MBean
JMX_INVOKE OPERATIONNAME="executeAndMail",MBEAN="UC4:name=CrystalReports",PARAMS="report,settings,mail"

Parameters

As the above example shows, values are allocated to a keyword and then assigned to the relevant parameter. In doing so, the JMX agent can distinguish report settings.

Parameter

Description

Report details

Available keywords:

  • "URL" - Address of the Web service
  • "REPORT" - Name and path of the report
  • "FORMAT" - File format for the report output ("CRYSTAL_REPORT", "EXCEL", "WORD", "PDF", "RTF", "TEXT_PLAIN", "TEXT_PAGINATED", "TEXT_TAB_SEPARATED", "TEXT_CHARACTER_SEPARATED", "EXCEL_DATA_ONLY", "TEXT_TAB_SEPARATED_TEXT", "RTF_EDITABLE", "USER_DEFINED")
Specifically for the operation "executeAndMail":
  • "MAIL_SUBJECT" - E-mail subject
  • "MAIL_BODY" - E-mail message
  • "MAIL_FROM" - Sender's e-mail address
Specifically for the operation "executeAndSave":
  • "FILE" - Path and name of the output file

Report attributes

Specify the attributes which should be considered in the report.

Keywords depend on the  report.

Email receiver

Indicate the e-mail address as the keyword. The value is either "TO" for the receiver or "CC" for the receiver who should be copied.

Return Codes

After having successfully processed the Crystal Report, the JMX job returns code "0". In the case of an error, it supplies either "1" if an error occurs when calling the operation or "3" if an MBean program error occurs. The report shows detailed information about the cause of the error.

The job status is also output in the report:

Report execution is continuously monitored if the status is either "0" or "9".

 

See also:

Support of Business Objects (Crystal Reports)