on 03-10-2010 2:08 PM
Hi,
I am using Crystal XI
I have a string variable in my formula that gathers log ids found when report is run. I then use this variable to display records in my subreports. But when I run a report with wider search criteria I get an error - Error: String can be at most 65534 characters.
How can I get rid of this error? Below is my formula
WhilePrintingRecords;
Global StringVar Array_Name;
numbervar slno;
Array_Name:= Array_Name & Cstr({PMP.LOG_ID}, 0) & ",";
if {@TimelyComplete}= 0 then
slno:= slno+ 1;
What would be an alternative solution for this problem?
Thanks for your help!
-Ekta
It's kinda a pain, but when I ran into this, I resorted to arrays: Define a global string array and a global number variable that points to the current array element being used. Before concatenating the value to the end of the current element, make sure that the element's length plus the length of the value being concatenated is less than the limit. If not, expand the array by 1 element and assign the new value to the new array element.
HTH,
Carl
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Storing the values would look something like this (basic syntax):
global vals(1) as string
global nextIndex as number
if nextindex = 0 then
nextIndex = 1
end if
if len(vals(nextIndex)) + len({field_to_add}) > 65530 then
nextIndex = nextIndex + 1
redim preserve vals(nextIndex)
vals(nextIndex) = {field_to_add}
else
vals(nextIndex) = vals(nextIndex) + ", " + {field_to_add}
end if
HTH,
Carl
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.