Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Tips and Tricks
Message Icon Topic: Using camma's in parameter fields Post Reply Post New Topic
Author Message
Jblain
Newbie
Newbie
Avatar

Joined: 08 Feb 2008
Location: United States
Online Status: Offline
Posts: 4
Quote Jblain Replybullet Topic: Using camma's in parameter fields
    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
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet 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 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>
IP IP Logged
Jblain
Newbie
Newbie
Avatar

Joined: 08 Feb 2008
Location: United States
Online Status: Offline
Posts: 4
Quote Jblain Replybullet 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
IP IP Logged
Jblain
Newbie
Newbie
Avatar

Joined: 08 Feb 2008
Location: United States
Online Status: Offline
Posts: 4
Quote Jblain Replybullet 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
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.032 seconds.