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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Yet *ANOTHER* Parameters Issue (CR 7.0) 3

Status
Not open for further replies.

Cherrel

Technical User
Dec 5, 2001
34
US
Greetings to All!

I am writing a report entitled, "EQUIPMENT LIST". In this EQUIPMENT LIST, I'm including such fields as: Equipment Number, Description, Model Number, Serial Number, and Project. Yesterday, I was able to create a report based on these fields and sorting on any ONE of those fields.

I have been trying to revamp that report now to allow the user to choose to SORT/GROUP BY on either the PROJECT field (with many choices under this field) or the LOCATION field (also containing many choices). Although, what I would REALLY like to do is set up a report that would allow me to choose a PROJECT (ie, ABC-123) and choose a LOCATION (ie, 00015) and only return me information from PROJECT 'ABC-123' and from LOCATION '00015' and give me a choice as to which field (DESCRIPTION, S/N, or even MODEL NUMBER) to sort by. (And of course the rest of the fields populate, accordingly.)

I hope that I haven't confused anyone. I have been playing with this report for most the day only to become upset and not produce anything.

PLEASE HELP! I'm so frustrated right now.

Thanks,
Cherrel. :cool:
 
Set up a parameter for location and one for project.
You can then enter the value for each.
Your selection is then based on your parameter and
your reports selects only the location & project
you entered. If your information is static and not
lengthy you could display a pop up list.
 
John43,

Thank you sir for your prompt response. OK, well, at least I know that I'm on the right track because I have already done this. In the FORMULA box I am using IF-THEN-ELSE statements. It still does not return the proper information to my report. If I select from the drop-down box for PROJECT 'ABC-123' and I enclude 'ABC-123' in my formula box, it returns ALL my information from w/in my database.

Do you have any ideas as to how the FORMULA should read?

Cherrel.
 
You need to write a record selection formula that ties in the parameter value to the report. Just selecting a certain value for a parameter in and of itself does not do the trick. Click on report, edit selection formula, record and the formula should be something like this:

{databasefield}={?Parameterfield}

Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Good Morning All!

OK, here's the deal....

I have set up parameters and formulas for both PROJECT & LOCATIONS. Taking PROJECT as an example, I created a Parameter for our projects including a condensed verison of the actual list and that appears to be working well. Gives me a "look-up" table and allows for me to select it. In the formula field, I have done what DGILLZ told me by setting up a formula that says,

(PROJECT2 FORMULA)

'IF {?Project} = "ABC-123" then {@project}
ELSE
IF {?Project}= "321-CBA" then {@project}
ELSE ...'

(PROJECT FORMULA)
'{equipment.eq1} = {?Project}'

** What my result is *ALL* my projects coming up not just the one that I choose.


===================================================

Yesterday, I created two seperate parameter fields with the formulas looking like this:

(PROJECT FORMULA)
'IF {?Project} = "ABC-123" then {equipment.eq1}
ELSE
IF {?Project}= "321-CBA" then {equipment.eq1}
ELSE ...'

And did not have the "PROJECT FORMULA" from above and the results were a hodgepodge of information.

I'm so new to CR...I can't thank you all enough for your help!!

Cherrel.:cool:
 
Forget if, then, else.
Just try a simple selection.
Let the parameter prompt you for the input, then
input your selection, abc-123 and see what results
you get.
 
OK, IT WORKS!! WHOO HOOO!

What I had been forgetting to do was set up the "@formulas" in the SELECT EXPERT. *DUH* Also, the sort by wasn't working because I had forgotten to code in the "@sort by" into the SORT BY function.

IT WORKS! THANKS TO ALL THAT HELPED!!!

I'm one happy girl! :-Q
Cherrel.
 
you need 3 parameters

Parameter 1: Project
string type ,
Description: Type in a Project number or "ALL" for all
projects.
default: ALL

Parameter 2: Location
string type ,
Description: Type in a Location number or "ALL" for all
projects.
default: ALL

Parameter 3: Report Sorting
string type
Description: Type "1" to sort by DESCRIPTION, "2" by S/N,
"3" by MODEL NUMBER
default: (which ever is most common)

in the record select put the formula

{Table.Project} like switch
( uppercase({?Project }) = "ALL", "*",
true, uppercase({?Project })
) and
{Table.Location} like switch
( uppercase({?Location }) = "ALL", "*",
true, uppercase({?Location })
) and

Create a record called RecordSort

@RecordSort

Select {?ReportSorting}
case "1":
{Table.description}
case "2":
{Table.SIN)
case "3":
{Table.ModelNumber)
default:
(designate something to default to);

now go to Report|Sort Records

and add this formula or alternatively create a group based on this formula

Hope this helps

Jim
 
How could I pass my COM Function or Stored Procedures with parameters into Crystal Report.

Example ::

crystalreport.sql = &quot;Select * from where <tablename> = <myparameter>&quot;
crystalreport.action = 1

 
Michaellince,

please post this as a new question in the Integration forum Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top