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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Charting on Print Time formulas - array error 1

Status
Not open for further replies.

pb100

Programmer
Aug 31, 2006
36
US
Hi all,
I am using CRXI with SQL. I have implemented the instructions from the Charting on Print-Time Formulas white paper and am getting the error "A subscript must be between 1 and the size of the array".

I was able to reproduce the example from the white paper and the chart worked but when converting over to my own data, I get the subscript error.

I have two tables, parent and child, where the grouping is based on a name field in the parent table and the # Red is based on fields in the multiple child records related to a record in the parent table. GROUP 1 is the name field in the parent table.

My "PerCent" formula is:
//This formula uses Crystal syntax.
WhilePrintingRecords;
Shared NumberVar curCounter;
Shared NumberVar curTotal;
curCounter := curCounter + sum({@# Red},{@GROUP 1});
curTotal := (curCounter/Sum ({@# Red}))*100;
ToNumber(curTotal);

where {@# Red} is Num1 * Num2 * Num3 from the child table.

All the other formulas and the subreports links are the same as the whitepaper. The formula causing the error is the split portion of the "SubShowValue" formula: ToNumber(split({?Pm-@ShowValue},"^")[RecordNumber]).

Any help is greatly appreciated!
 
I wonder if you should be using groupnumber instead of recordnumber.

-LB
 
LBass, that's it! Wow, thank you so much! I spent way too much time on this, should have written in sooner...!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top