Print Page | Close Window

Can I use a Formula in a Parameter field?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=9544
Printed Date: 27 Apr 2024 at 5:20pm


Topic: Can I use a Formula in a Parameter field?
Posted By: flanman
Subject: Can I use a Formula in a Parameter field?
Date Posted: 30 Mar 2010 at 7:04am
I was asked to create two reports that group info by certain weekdays. Instead of creating two separate reports my plan is to create one report and prompt the user for which group they want to view.
One group is Tue-Thur. The second is Fri-Sat. They want to look at this data separately. So I create two simple formula like this:
Formula1 DayOfWeek({FixedSites2009.Date}) in [3,4,5] and
Formula2 DayOfWeek({FixedSites2009.Date}) in [6,7]

So can I create a parameter or some type of select statement that prompts the user when they launch the report to choose one or the other?

Flanman





Replies:
Posted By: DBlank
Date Posted: 30 Mar 2010 at 7:13am
You cannot use a formula to define a dynamic param but you can create a param that you just add the strings of 'Tu-Th' and 'Fr-Sa' then in your select expert:
({?Param}='Tu-Th' and DayOfWeek({FixedSites2009.Date}) in [3,4,5])
or
({?Param}='Fr-Sa' and DayOfWeek({FixedSites2009.Date}) in [6,7])


Posted By: flanman
Date Posted: 30 Mar 2010 at 8:36am
Once again great help from great people.

Thanks,

Flanman


Posted By: User_dp123
Date Posted: 02 Aug 2018 at 11:43am
Still helpful 8 years later!



Print Page | Close Window