RVReportGetErrorString

<< Click to display table of contents >>

RVReportGetErrorString

Returns a localized error message for the specified error code.

Unit RVReportErrors;

Syntax

procedure RVReportGetErrorString(ErrorCode: TRVReportGeneratorError;
  out ErrTypeStr, ErrStr: TRVUnicodeString; RelatedObject: TObject;
  ErrorTypes: PRVReportGeneratorErrorTypeStr = nil;
  ErrorMessages: PRVReportGeneratorErrorStr = nil;
  ParserErrorMessages: PRVReportParserErrorStr = nil;
  ExprEvalErrorMessages: PRVReportExprEvalErrorStr = nil
  );

This procedure can be used in TRVReportGenerator.OnError event. Pass ErrorCode and RelatedObject parameters of this event as an input parameters of this procedure.

There are two output string parameters: ErrTypeStr and ErrStr.

ErrTypeStr receives a string that describes a type of this error (e.g. like 'Variable error' or 'Cross-tabulation error').

ErrStr receives a string that describes the specific error. This is usually a format string. To get a final string, call Format(ErrStr, [RelatedText]), where RelatedText is a parameter of OnError event.

The rest of parameters are pointers to arrays of error messages. Normally, you can omit them, and default global variables will be used. Before using these arrays (including default global arrays), you need to initialize them using RWA_LocalizeErrorMessages.

See the example in the topic about TRVReportGenerator.OnError.