on 2021 Oct 01 6:02 PM
Hello All,
I am getting the following error :
An array's dimension must be an integer between 1 and 1000
with the following formula. Please advise.
WhilePrintingRecords;
stringvar array plant;
redim preserve plant[GroupNumber];
plant[GroupNumber] := GroupName ({Command.EVSTRNAME});
Request clarification before answering.
You have to initialize an array with at least one entry before you can call ReDim on it. Also, I wouldn't necessarily use "GroupNumber" - instead I would use Ubound() to determine the current size of the array.
So, here's what you'll change your formula to something like this:
WhilePrintingRecords;
StringVar array plant := MakeArray(1);
NumberVar i;
If OnFirstRecord then
plant[1] := GroupName({Command.EVSTRNAME});
else (
i := UBound(plant);
redim preserve plant[i + 1];
plant[i + 1] := GroupName({Command.EVSTRNAME});
);
""
The final empty string at the end of the formula allows you to put the formula on your report so that it will calculate but won't show anything.
Also, if you're using just the data value for a group's name and aren't using a formula for the group name, you don't need to use the "GroupName()" function - you can just use the field.
Finally, I see you're using a command. If you haven't already, I suggest you read this blog about best practices for working with commands.
-Dell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was able to make it work. Thank you Dell for your help. Here is my updated formula:
WhilePrintingRecords;
StringVar array plant := MakeArray( " ");
NumberVar i;
If OnFirstRecord then plant[1] := GroupName({Command.EVSTRNAME})
else ( i := UBound(plant);
redim preserve plant[i + 1];
plant[i + 1] := GroupName({Command.EVSTRNAME});
); ""
Hello Dell,
I have got the same error when published on the server. Here is the error details;
2021-10-01 13:26:20
com.businessobjects.report.web.shared.WebReportingException: The viewer could not process an event. Error in File CONT Working Hours - Oct1:
Error in formula Formula1:
'WhilePrintingRecords;
'
An array's dimension must be an integer between 1 and 1000.
Error in formula Formula1:
'WhilePrintingRecords;
'
An array's dimension must be an integer between 1 and 1000.
Details: errorKind---- Error code:-2147215357 [] Error code name:internal
User | Count |
---|---|
78 | |
22 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.