Class ReportException

All Implemented Interfaces:
com.inet.error.HasErrorCode, Serializable
Direct Known Subclasses:
FatalParserException, KeyNotFoundException, PageOutOfRangeException

public class ReportException extends Exception implements com.inet.error.HasErrorCode
This is the base class of the i-net Clear Reports exception hierarchy. This exception is thrown whenever an unrecoverable error occurs within i-net Clear Reports.
Since:
6.0
See Also:
  • Constructor Details

    • ReportException

      public ReportException(String msg, int errorCode)
      Creates a new report exception.
      The message msg is sent to the client viewer with the message number messageId. The message string is not translated in any way and you can use any messageId you want if you follow the convention that the java viewer bean interprets negative messageId's as warnings and positive numbers (>0) as errors. The error/warning message is shown by the java viewer bean in the dialog box.
      For example you can use this method in the checkProperties() method to send a message to the client:
      
       if(prop.getProperty("user", "").equals("peter")) { 
           throw new ReportException("Access denied", 105);
       }
      Parameters:
      msg - The formatted message
      errorCode - An integer you can associate with your message and which will be shown by the client. The java client uses the convention that a id<0 is interpreted as a warning and id>0 as an error message.
      Since:
      6.0
  • Method Details

    • toString

      public String toString()
      Returns a string which contains the message id and the message
      Overrides:
      toString in class Throwable
      Returns:
      String
      Since:
      6.0
    • setCause

      @Deprecated public ReportException setCause(Throwable cause)
      Deprecated.
      As of i-net Clear Reports 14.1, replaced by Throwable.initCause(Throwable)
      Sets the cause for this exception. This is equals to initCause.
      Parameters:
      cause - The cause is the throwable that caused this ReportException to get thrown.
      Returns:
      a reference to itself.
      Since:
      6.0
    • getErrorCode

      public int getErrorCode()
      Returns an error code that describes the cause for this exception.
      Specified by:
      getErrorCode in interface com.inet.error.HasErrorCode
      Returns:
      An error code that describes the cause for this exception.
      Since:
      6.0