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

Record selection formula

Status
Not open for further replies.

northw

MIS
Nov 12, 2010
140
US
Hi,
I am new to crystal, any help is appreciated, The issue is writing a record selection formula, We have a JSP app through which our users access reports. The requirement is, There is Name and serial number for an equipment, If the user selects Name it has to populate all the Machine's available or if the user selects serial number it has to select the select the serial number it has to populate the serial number's from the database, So if they select either one, there is a drop down that will populate accordingly.

I am writing a formula for that in the record selection, which is returning error, We are using universe, If it is possible at the universe level we can do that too.
The formula I wrote is:
(
IF {?Equip} = 'Name' then {Query1.Machine}
Else IF {?Equip} = 'Serial Number' Then {Query1.Serial number}
)
It is throwing me an error.
Thanks, Any help is appreciated.
 
What error? Are you mixing text and pure number? (This can be solved by ToText({Numeric.value}))

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
The Error I get is
The result of a selection formula must be a Boolean.

Thanks
 
It is unclear whether you are trying to create the picklist for the dropdown, or whether you want to select records for the main report based on this formula.

-LB
 
Thanks a lot for your valuable time.
To explain in detail,
Our users access reports through a JAVA App, Now the requirement is, they have a prompt field (IDENTIFIER), which has two values "NAME" and "SERIAL NUMBER", when users select NAME, then they get all the Names of available Machines from the database, using "MACHINE ID" field, in the same way when they select "SERIAL NUMBER" the list is displayed for available Machines, Here is the trick, there are a few machines with out "SERIAL NUMBER", So the prompt has to check for the available MACHINE NAME with SERIAL NUMBERS and vice verse, And for the two different selections they are sing MACHINE ID to determine and display the values which are available.

Hope this gives little bit insight into the issue,

Thanks for the Help.
 
Hi,
are these selections ( of what to show in the list) made within Crystal or in the Java app before being sent to CR?



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
You didn't really answer my question, so please try again.

Also, can you confirm that you are creating the parameter
{?Identifier} in Crystal?

-LB
 
It is unclear whether you are trying to create the picklist for the dropdown, or whether you want to select records for the main report based on this formula.

Yes, Pick list, and if the user can select one or all.


Also, can you confirm that you are creating the parameter
{?Identifier} in Crystal?

Yes. We create one in the crystal reports, but the values will be passed from the App.

 
A selection test must be either true or false: this is called a 'Boolian' in Crystal. If you had
Code:
{?Equip} = 'Name'
That would return 'True' or 'False' if you put it on your detail line, and could also be used for selection.

The formula you first showed ends up with a definite value, from one of two possible sources. Logically your selection should be compairing the value in this field against something else.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 11.5 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top