×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Business Objects: Crystal Reports 1 Formulas FAQ

## Formula Help

 Displaying parameters chosen using a formula by synapsevampire faq767-5684 Posted: 15 Feb 05 Displaying the parameter choices made for the user:String parameters:Discrete:{?MyStringParameter}Range value separated by ô to ö:Minimum({?MyStringParameter})&" to "& Maximum({?MyStringParameter})Multiple Discrete values separated by a comma:join({?MyStringParameter},",")Multiple Range values separated by a carriage return:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyStringParameter}) do(Output:= Output&minimum({?MyStringParameter}[Counter])& " to "& maximum({?MyStringParameter}[Counter])&chr(13));left(Output,len(Output)-1)Multiple Range and Discrete values separated by a carriage return:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyStringParameter}) do(if minimum({?MyStringParameter}[Counter])= maximum({?MyStringParameter}[Counter]) thenOutput:= Output & minimum({?MyStringParameter}[Counter])&chr(13)elseOutput:= Output & minimum({?MyStringParameter}[Counter])& " to "& maximum({?MyStringParameter}[Counter])&chr(13));left(Output,len(Output)-1)Numeric parameters:Discrete:{?MyNumericParameter}Range value separated by ôtoö:Minimum({?MyNumericParameter})&" to "& Maximum({?MyNumericParameter})For concerns with decimal precision and thousands separator, use:totext(Minimum({?MyNumericParameter}),0,"")&" to "& totext(Maximum({?MyNumericParameter}),0,"")Multiple Discrete values separated by a comma:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyNumericParameter}) do(Output:= Output& totext({?MyNumericParameter}[Counter],0,"")& ",");left(Output,len(Output)-1)Multiple Range values separated by a carriage return:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyNumericParameter}) do(Output:= Output& totext(minimum({?MyNumericParameter}[Counter]),0,"")& " to "& totext(maximum({?MyNumericParameter}[Counter]),0,"")&chr(13));left(Output,len(Output)-1)Multiple Range and Discrete values separated by a carriage return:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyNumericParameter}) do(if minimum({?MyNumericParameter}[Counter])= maximum({?MyNumericParameter}[Counter]) thenOutput:= Output & totext(minimum({?MyNumericParameter}[Counter]),0,"")&chr(13)elseOutput:= Output & totext(minimum({?MyNumericParameter}[Counter]),0,"")& " to "& totext(maximum({?MyNumericParameter}[Counter]),0,"")&chr(13));left(Output,len(Output)-1)Date parameters:Discrete:{?MyDateParameter}Range value separated by ôtoö:Minimum({?MyDateParameter})&","& Maximum({?MyDateParameter})Multiple Discrete values separated by a comma:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyDateParameter}) do(Output:= Output& {?MyDateParameter}[Counter]& ",");left(Output,len(Output)-1)Multiple Range values separated by a carriage return:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyDateParameter}) do(Output:= Output& minimum({?MyDateParameter}[Counter])& " to "& maximum({?MyDateParameter}[Counter])&chr(13));left(Output,len(Output)-1)Multiple Range and Discrete values separated by a carriage return:whileprintingrecords;stringvar Output:="";numbervar Counter;For Counter := 1 to ubound({?MyDateParameter}) do(if minimum({?MyDateParameter}[Counter])= maximum({?MyDateParameter}[Counter]) thenOutput:= Output & minimum({?MyDateParameter}[Counter])&chr(13)elseOutput:= Output & minimum({?MyDateParameter}[Counter])& " to "& maximum({?MyDateParameter}[Counter])&chr(13));left(Output,len(Output)-1)As you can see from these examples, the differences between string and numeric (or dates and other data types) is that you must first convert non-string data types to a string, hopefully this will allow you to handle any data types.-k Back to Business Objects: Crystal Reports 1 Formulas FAQ Index Back to Business Objects: Crystal Reports 1 Formulas Forum

Close Box

# Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!