Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting data from user

Status
Not open for further replies.

PerrinA

Programmer
Jul 26, 2001
15
US
I have a report that is supposed to print Sales Reports by county. The problem is, the only data is in zip code. I was wondering if there is a way to let the user enter a county name so that I can use an if/then/else statement to limit the zipcodes shown.
-Thanks
Jason
 
I'm assuming that you already have some kind of reference to attribute the zips to relevant counties.

The easiest option, if you have it, would be to save a zip list with corresponding counties to a txt file, and load the file into a parameter.

Alternatively, you could convert this with an If/Then/Else parameter conversion in the Select Expert, but a more straightforward way to do this if you only have zip data is to base a parameter on the zip field, and in the description of each value, enter the corresponding county. Set the parameter so that the description is displayed instead of the value at runtime.

I don't really fancy this, or any of your available options if you have no online reference file, as obviously if you have loads of zip codes, you'd better think about cancelling any plans you had for leaving work early. But, being as your data sounds pretty limited, then so are your options, I'm afraid to say.

It might be an idea to trawl through Google for some kind of zip-to-county legend (like copy it into a txt file, and use the file for your parameters. You might be sailing pretty close to copyrighting/permission requests - but there you go...

Naith
 
Create a parameter field to prompt the user, then tie the parameter field into the record selection formula to limit the records on the report.

Create a new parameter field by insert, field object, parameter field. Software Training and Support for Macola, Crystal Reports and Goldmine
714-348-0964
dgilsdorf@mchsi.com
 
As mentioned by Naith...this is one daunting task to hard code in Crystal...but then it depends on the scope of your report...

It may be doable if the report is on sales by simply one state but I had a look at the website and the ZIP CODES for each county are not sequential

for TEXAS

Anderson 75763 75779 75801 75802 75832 75839 75853 75861
75880 75882 75884 75886
Refugio 77950 77990 78340 78377 78393

As a result you cannot even give a range of zip codes for a county.

the sheer volume of zipcodes makes it impossible to hard code or use in a picklist.

My suggestion is that you get your own database updated so that County name is included with the records...failing that somehow create a table of county name/zipcodes and link onto it...then you can specify the county by name in a parameter and let Crystal find them for you.

Jim Broadbent
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top