Print Page | Close Window

Using camma's in parameter fields

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Tips and Tricks
Forum Discription: Have you learned some great tricks to share with the group? Post them here!
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=2315
Printed Date: 18 May 2024 at 9:50pm


Topic: Using camma's in parameter fields
Posted By: Jblain
Subject: Using camma's in parameter fields
Date Posted: 13 Feb 2008 at 8:42am
Quick question... I have a Report that I have to enter 1000's of numbers. Is there a way within the parameter field I can set it to allow comma's?
 
Right now I have to copy the number from excel and past it into the parameter field. The hit the button to add to the list of numbers to run the report from and copy another number and so on.
 
If the parameter field would allow a comma I could do one big paste.
 
Hope someone can help!! Thanks!


-------------
Jblain



Replies:
Posted By: BrianBischof
Date Posted: 13 Feb 2008 at 9:10am
You can make the parameter a string and that way it accepts a comma delimited list of numbers. For the record selection filter to test if a number is in the list, use the following sample code:
CStr({table.yourfield},"#") IN Split({?parameter},",");

This functions splits the string into an array using the comma separator and then it tests if the field is in the array.

I actually wrote about this exact problem on page 190 of my book http://www.amazon.com/exec/obidos/ASIN/0974953601/bischofsystem-20 - Crystal Reports Encyclopedia .

-------------
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>


Posted By: Jblain
Date Posted: 13 Feb 2008 at 9:48am

Thanks for the advice. I see now where that can make it work, but I get an error that a string is required and it highlights "{?RX #}". Is it wanting the numbers there? My code is below:

CStr({Billing.RxNo},"#")IN Split({?RX #},",")and
{Billing.MOP} = "guar"
 
Thanks again for your help and I did check out the book. Decent price!


-------------
Jblain


Posted By: Jblain
Date Posted: 13 Feb 2008 at 10:40am
I got it! I used the string, but never made the parameter a string! Armature mistake! Thanks!!!

-------------
Jblain



Print Page | Close Window