Print Page | Close Window

Parameter based on a formula?

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=11017
Printed Date: 07 May 2024 at 3:24pm


Topic: Parameter based on a formula?
Posted By: Megan10e
Subject: Parameter based on a formula?
Date Posted: 01 Sep 2010 at 10:43am
I want my report to display customers whose order totals fall into certain ranges, but the order totals are a calculation (the orders are on the database as separately, but I'm using a formula to get the total of the orders). I need to create a parameter based on that formula, so that I can use conditional formatting to only show customers whose order totals fall into the selected ranges.
 
How could I do this in a different way?



Replies:
Posted By: FrnhtGLI
Date Posted: 02 Sep 2010 at 2:17am

Instead of using the parameters in the Selection Expert, use them to suppress the detail when they don't meet the criteria in the Section Expert.



-------------
|< /\ '][' ( )


Posted By: Megan10e
Date Posted: 07 Sep 2010 at 10:52am
Okay, I did this, and it works well if I'm only selecting one range, but I want the parameter to allow for multiple selections.
 
My formula looks like this:
 
({?Range Select}="< 101" and Sum ({HORDHDR.ORDERTOTAL},{HORDHDR.CUSTNO}) >100.99)
or
({?Range Select}="101-1000" and Sum ({HORDHDR.ORDERTOTAL},{HORDHDR.CUSTNO})  <> 101 to 1000.99)
or
({?Range Select}="1001-2500" and Sum ({HORDHDR.ORDERTOTAL},{HORDHDR.CUSTNO})  <> 1001 to 2500.99)
etc.
 
So the formula is saying: suppress this section when the parameter chosen is "< 101," and the totals come to more than 101, so all the totals I want are shown. But when I select more than one range, they cancel one another out and no values are shown. How can I fix this?



Print Page | Close Window