1573642 - Error: Subscript must be between 1 to length of string

SAP Knowledge Base Article - Public

1573642 - Error: Subscript must be between 1 to length of string

Symptom

Error: Subscript must be between 1 to length of string

Environment

Crystal Reports 2008

Reproducing the Issue

  1. By Default Crystal reports string can hold 1 to 255 characters only.
  2. If we try to hold more than 255 character for a String at runtime we would have an error as the value for the String must be between 1 to 255.

Cause

Error: Subscript must be between 1 to length of string

Resolution

  1. We can break the String into couple of individual String variable and while displaying we can concatenate the 2 strings.
  2. Create a Formula to calculate merge row number to the existing string.
    1. StringVar x1, x2;
    2. NumberVar RowCnt;
    3. RowCnt:=RowCnt+1;
    4. If length(x1)<255 then x1:=x1&RowCnt
    5. else x2:= x2&RowCnt;

Keywords

Subscript, Crystal reports , KBA , BI-RA-CR , Crystal Reports designer or BusinessViews Manager , Problem

Product

SAP Crystal Reports XI