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 |
Two steps are required to execute a report:
The MBean "CrystalReports" is automatically registered by the JMX agent. It is not necessary to call the function JMX_CREATE_MBEAN.
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"
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:
|
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. |
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)