Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An Array's dimension must be an integer between 1 and 1000

Status
Not open for further replies.

sarah1147

Programmer
Apr 8, 2011
5
US

Created a sub report in which some calculation are done.
Then change those number into string and calling them in MAIN report just to show them in groups with each group
giving different numbers.
but at the report run time gets an error " An Array's dimension must be an integer between 1 and 1000"
The variable is called in the report as this:
"evaluateafter({@groupdisp});
numbervar grpadd;
shared stringvar str_gas;
tonumber (split(str_gas,"^")grpadd)"

it is displaying a long thread of number as 1^2^3^4^5^6^7^8^9
each number has to be displayed at respective group level.

in the subreport it is declared as:
WhilePrintingRecords;
shared numbervar gasoline;
shared stringvar str_gas := str_gas + totext(gasoline) + "^";

while "shraed numbervar gasoline" is described as
shared numbervar gasoline;
gasoline := Sum ({@cust_set_total}, {P_LIQ_STLMNT_AGMT_BY_STATION.STATION_CD})

any help on this would be appreciated.

 
you do not appear to be declaring a value for grpadd

also when using grpadd it must be wrapped on square brackets

tonumber (split(str_gas,"^")[grpadd])

Also there is a spurious " at the end of yor tonumber function.

Ian

 
for the group value, its going to add into the following group.
i wrapped it in square brackets, but same error.
'tonumber' is also providing me an error 'string is no numeric'
so i replace with 'totext'.

now the error is 'a subscript must be between 1 and the size of the array'

size of the array:
i do not have info on that. it can varies from 50 to 500 or maybe more.

thanks for your reply waterman
 
for the group value

it is

numbervar grpadd := grpadd+1;
 
can you explain where in the report each formula is placed?

I agree that it sounds like the value for grpadd is zero at the time of the error.

What are the contents of the formula (@groupdisp)? I might have missed it, but didn't see it.
 
what happens if you replace the grpadd variable with a whole number ie: instead of "tonumber (split(str_gas,"^")[grpadd])"
you would have "tonumber (split(str_gas,"^")[4])" or "tonumber (split(str_gas,"^")[1])
 
if you remove 'tonumber' and use [1] instead of [grpadd] what are your results?

split(str_gas,"^")[1]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top