Limiting Record Selection in Sub Reports

Printed From: Crystal Reports Book — Forum Name: Talk with the Author

Hi,

I have a sub report that takes part number (multi-valued Cascade Pick List parameter).  Since users can pick as many part as they want from pick list, I want to restrict their choices to the first 4 they pick.
I initially tried to use Redim Preserve function in a sub report forumula that
1. Reads the linked parameter from main report into a string variable
2. Sets the dimension to 4 elements and
3. Returns one of the elements like below:
 
WhileReadingRecords;
// Read linked main report parameter to a local array variable
StringVar Array PartList := {?Pm - PartNumber - PART_NO}
Redim PartList [4];
Partlist [1]
 
I named the formula PartListSub1 have 3 more formulas like the one above for rest of the elements in the array.  Then, I put them in a selection formula for the subreport like below
 
{PART_VIEW.PART_NO} = {@PartListSub1} or
{PART_VIEW.PART_NO} = {@PartListSub2} or
{PART_VIEW.PART_NO} = {@PartListSub3} or
{PART_VIEW.PART_NO} = {@PartListSub4}
 
It is not working for some reason. What am I doing wrong? Or is there another way to restrict the parameter entry to only 4 elements (besides putting a warning in the prompt).
 
Thanks in advance for your help.