Symptom
Error: Subscript must be between 1 to length of string
Environment
Crystal Reports 2008
Reproducing the Issue
- By Default Crystal reports string can hold 1 to 255 characters only.
- 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
- We can break the String into couple of individual String variable and while displaying we can concatenate the 2 strings.
- Create a Formula to calculate merge row number to the existing string.
-
StringVar x1, x2;
-
NumberVar RowCnt;
-
RowCnt:=RowCnt+1;
-
If length(x1)<255 then x1:=x1&RowCnt
-
else x2:= x2&RowCnt;
-
Keywords
Subscript, Crystal reports , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports XI