[]
        
(Showing Draft Content)

GrapeCity.ActiveReports.PageReportModel.Validation.ValidationUtils.ValidateLength

ValidateLength Method

ValidateLength(Length, Length, Length, params Length[])

Validates a length value to make sure it is valid and is within the specified min/max range limit.

Declaration
public static void ValidateLength(Length value, Length min, Length max, params Length[] extraValues)
Parameters
Type Name Description
Length value

A Length value to validate.

Length min

A Lengthvalue representing the minimun size allowed.

Length max

A Lengthvalue representing the maximum size allowed.

Length[] extraValues

The additional allowed Length values.

Examples
Length value = new Length("2in");
Length min = new Length("1in");
Length max = new Length("5in");
ValidationUtils.ValidateLength(value, min, max, new Length("0in"));
Exceptions
Type Condition
ReportDefinitionException

Throws if the value is out of range limit.

ValidateLength(Length, params Length[])

Validates a length value against the RDL defined min/max length defaults ("0in","160in").

Declaration
public static Length ValidateLength(Length value, params Length[] extraValues)
Parameters
Type Name Description
Length value

A Length value to validate.

Length[] extraValues

The additional allowed Length values.

Returns
Type Description
Length
Examples
Length value = new Length("2in");
ValidationUtils.ValidateLength(value, new Length("200in"));
Exceptions
Type Condition
ReportDefinitionException

Throws if the value is out of range limit.

ValidateLength(Length, bool)

Validates a length value against the RDL defined min/max length defaults ("0in","160in").

Declaration
public static void ValidateLength(Length value, bool hasNoMaxValue)
Parameters
Type Name Description
Length value

A Length value to validate.

bool hasNoMaxValue

A boolean value indicating if there should be validation against the default max value.

Exceptions
Type Condition
ReportDefinitionException

Throws if the value is out of range limit.

ValidateLength(ExpressionInfo, Length, Length)

Validates an expression value to make sure it is valid length value and is within the specified min/max range limit.

Declaration
public static void ValidateLength(ExpressionInfo expression, Length min, Length max)
Parameters
Type Name Description
ExpressionInfo expression

An ExpressionInfo value to validate.

Length min

A Length value representing the minium size allowed.

Length max

A Length value representing the maximum size allowed.

Examples
ExpressionInfo value = ExpressionInfo.FromString("2in");
Length min = new Length("1in");
Length max = new Length("5in");
ValidationUtils.ValidateLength(value, min, max);
Exceptions
Type Condition
ReportDefinitionException

Throws if the value is out of range limit.

ValidateLength(ExpressionInfo)

Validates an expression value to make sure it is valid double value and against the RDL defined min/max length defaults ("0in","160in").

Declaration
public static void ValidateLength(ExpressionInfo expression)
Parameters
Type Name Description
ExpressionInfo expression

ExpressionInfo value to validate.

Examples
ExpressionInfo value = ExpressionInfo.FromString("2in");
ValidationUtils.ValidateLength(value);
Exceptions
Type Condition
ReportDefinitionException

Throws if the value is out of range limit.