Print Page | Close Window

Limiting Record Selection in Sub Reports

Printed From: Crystal Reports Book
Category: General Information
Forum Name: Talk with the Author
Forum Discription: Ask Brian questions about his books and give him your comments. Like the book? Hate the book? Have suggestions? Let me know!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=345
Printed Date: 03 May 2024 at 4:17pm


Topic: Limiting Record Selection in Sub Reports
Posted By: mwahid
Subject: Limiting Record Selection in Sub Reports
Date Posted: 18 Mar 2007 at 5:50pm

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} = mailto:%7b@PartListSub1 - {@PartListSub1 } or
{PART_VIEW.PART_NO} = mailto:%7b@PartListSub2 - {@PartListSub2 } or
{PART_VIEW.PART_NO} = mailto:%7b@PartListSub3 - {@PartListSub3 } or
{PART_VIEW.PART_NO} = mailto:%7b@PartListSub4 - {@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.


-------------
MW



Print Page | Close Window