INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Array Troubles Can Any Crystal Gurus help?

Array Troubles Can Any Crystal Gurus help?

(OP)
I have a list of 1,174 part numbers in an Access table. I need to convert the column of numbers to a row and format them to be used as a filter in Crystal Reports 2008.

From:
123
456
789

To:
"123", "456", "789"

I understand that Crystal has a limit of 1000 items and I have 1,174. I don't understand arrays much at all, I have spent the last 6 hours working on an array formula I found online for breaking an array up into two arrays then combining them in the report footer.

http://solveissue.com/note?id=1582308

The site has "totext(<field name>,"####")" in the formula for some reason, I took totext and "####" out because it was giving me an error message. "Too many arguments have been given to this function "####".

Here is my formula:

FORMULA for PNs detail row Test

Whileprintingrecords;

StringVar Array arrcount1;
StringVar Array arrcount2;

NumberVar i;

redim preserve arrcount2[distinctcount({AMT_Part_Numbers.AMT Part Numbers})-1000];
redim preserve arrcount1[1000];

i:=i+1;

if i<=1000 then arrcount1[i]:=({AMT_Part_Numbers.AMT Part Numbers}) else arrcount2[i]:=({AMT_Part_Numbers.AMT Part Numbers});

It accepts that formula.

When I run the report I get the following error regarding the formula:

"A subscript must be between 1 and the size of the array"
It highlights "else arrcount2[i]:={AMT_Part_Numbers.AMT Part Numbers};"

I cannot figure out how to get past this.

For reference here is the formula I'm using to display the arrays in the footer.

FORMULA for report footer to display PNs Test

Whileprintingrecords;
StringVar Array arrcount1;
StringVar Array arrcount2;

join(arrcount1[1 to DistinctCount({AMT_Part_Numbers.AMT Part Numbers})],",")+" , "+join(arrcount2[1 to DistinctCount({AMT_Part_Numbers.AMT Part Numbers})],",");

I don't know if I will have any problems with this if I can get beyond the errors in the first formula.

Thanks

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!