Skip to Content
0

Which report was delivered to who

Apr 26 at 08:42 AM

54

avatar image
Former Member

Hi,

I am getting a '[Postmaster] Email Delivery Failure' notification for a report but unhelpfully, Crystal is not saying which report it is for, only the recipient's email address is included in the message which is very generic and not divulging any information as to which report it is for.


Is there a way to find out which reports have generated a delivery failure notification or get a list of reports scheduled against which email addresses?

I am using Crystal Enterprise 10.0.

Thanks,

Marcia

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Dell Stinnett-Christy Apr 26 at 01:59 PM
0

Unfortunately, the delivery failure notification comes from the mail server. CE doesn't have any way to know which report it wasn't able to deliver.

If you were on a more recent version, I could provide some sample Java code to show how to get to the email information for schedules. However, I never worked with the SDK for CE, so I'm not sure how to get to that information there.

-Dell

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 03 at 01:29 PM
0

Hi Dell,


Thanks for your response. We are also running a later version, SAP BusinessObjects BI Platform 4.1 Support Pack 2, Version: 14.1.2.1121. Would your Java code work for this version?

Thanks,
Marcia

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Yes, it would.

This first set of code determines the destination type of a schedule, then creates an object that is specific to that type of destination. It uses the ISchedulingInfo from an IInfoObject.

private void loadDestination(final ISchedulingInfo si, final Logger log, final boolean forReschedule) {
    final IDestinations destList = si.getDestinations();
    for (final Object obj : destList) {
        final IDestination d = (IDestination) obj;
        final String destStr = d.getName();
        if (destinationType.isEmpty()) {
            destinationType = translateDest(destStr);
        } else {
            destinationType += ", " + translateDest(destStr);
        }
        if (destinationType.contains("Email")){
            destinationInfo = new DestinationEmail(destinationType, d, log, forReschedule);
        } else if (destinationType.contains("File")) {
            destinationInfo = new DestinationFile(destinationType, d, log);
        } else if (destinationType.contains("FTP")) {  // this will alsol catch SFTP.
            destinationInfo = new DestinationFTP(destinationType, d, log);
        } else if (destinationType.contains("Inbox")) {
        }
    }
}

private String translateDest(final String destStr) {
	String result = "";
	if (destStr.equals("CrystalEnterprise.Smtp")) {
		result = "Email";
	} else if (destStr.equals("CrystalEnterprise.DiskUnmanaged")) {
		result = "File";
	} else if (destStr.equals("CrystalEnterprise.Ftp")) {
		result = "FTP";
	} else if (destStr.equals("CrystalEnterprise.Sftp")) {
		result = "SFTP";
	} else {
		result = destStr.replace("CrystalEnterprise.", "");
	}
	return result;
}

This next set of code is the constructor for the DestinationEmail class mentioned above. It loads information about who the email is going to:

public DestinationEmail(String destStr, IDestination d, Logger log) {
  super(destStr);
  IProperties ip = d.properties();
  try {
    IProperties dprops = PropertyHelper.getIProps(ip, "SI_DEST_SCHEDULEOPTIONS", log);
    if (dprops != null) {
      _from = PropertyHelper.getStringProp(dprops, "SI_SENDER_NAME", log);
      _subj = PropertyHelper.getStringProp(dprops, "SI_MAIL_SUBJECT", log);
      _to = PropertyHelper.getStringFromProps(dprops, "SI_MAIL_ADDRESSES", log);
      _cc = PropertyHelper.getStringFromProps(dprops, "SI_MAIL_CC", log);
      _bcc = PropertyHelper.getStringFromProps(dprops, "SI_MAIL_BCC", log);
      _attach = PropertyHelper.getBooleanProp(dprops, "SI_SMTP_ENABLEATTACHMENTS", log);
      _msg = PropertyHelper.getStringProp(dprops, "SI_MAIL_MESSAGE", log);
      if (_attach) {
        IProperties ofprops = PropertyHelper.getIProps(dprops, "SI_OUTPUT_FILES", log);
        if (ofprops != null) {
           IProperties fnprops = PropertyHelper.getIProps(ofprops, "1", log);
          if (fnprops != null) {
            _file = PropertyHelper.getStringProp(fnprops, "SI_EMBED_NAME", log);
          }
          if (_file.isEmpty()) {
            _file = "(generated by BO)";
          }
        } else {
          _file = "(generated by BO)";
        }
      } else {
        _file = "Link to report, no file sent";
      }
    }
  }
  catch ( Exception e) {
    log.error("Unable to get EMail destination info.  Err=" + e.getMessage());
  }
}

The final set of code is for the getStringProp(), getStringFromProps(), and getIProps() methods used above.

public static String getStringProp(IProperties iprops, String prop, Logger log){
  String result = "";
  try {
    result = iprops.getString(prop);
  } catch (Exception e){
    if (log != null)
      log.debug("Unable to get " + prop + " property. Err=" + e.getMessage());
    result = "";
  }
  return (result != null ? result : "");
}

public static IProperties getIProps(IProperties iprops, String prop, Logger log){
  IProperties result = null;
  try {
    result = iprops.getProperties(prop);
  } catch (Exception e){
    if (log != null)
      log.debug("Unable to get " + prop + " property. Err=" + e.getMessage());
    result = null;
  }
  return result;
}

public static String getStringFromProps(IProperties iprops, String prop, Logger log){
  String result = "";
  IProperties mprops = getIProps(iprops, prop, log);
  if (mprops != null){
    int cnt = getIntProp(mprops, "SI_TOTAL", log);
    for (Integer i = 1; i <= cnt; i++){
      if (i == 1){
        result = getStringProp(mprops, i.toString(), log);
      } else {
        result += "|" + getStringProp(mprops, i.toString(), log);
      }
    }
  }
  return result.replace(", ", "|").replace(",", "|");
}

This should get you started.

-Dell

0
Former Member

This is great thanks Dell :)

0