Crystalkeen logo; we offer Crystal reports viewers and schedulers
 
Crystalkeen header image 3
Crystalkeen header image 5

Crystal Reports Tools: Improve Performance While Saving Time and Money

  Resources  
Best sellers:
cView
cViewSERVER
cViewBATCH

Articles:
Administration
Advanced
Basic
Database
Financial

Tools:

Analyzers
CR Schedulers
CR UFLs
CR Viewers
DataBase Tools
Graphics
International
Mail UFLs



 
 

Add'l:
About us

Contact Us
cViewSUITE Ppt

 

CrystalReports
on Steroids

Crystal Reports: Displaying a Range Parameter

One of the improvements in Crystal Reports v7 was that a parameter could be a range or be multiple values. But whereas it was easy to display a single value parameter in a report heading, the Crystal Report doesn’t display anything if the parameter is a range value.

You can display the range values of the parameter by using a formula as follows (for a date range parameter):

Totext(Minimum ({?ReportDate}),"dd-MMM-yyyy") +

" to " +

Totext(Maximum ({?ReportDate}),"dd-MMM-yyyy")

Numeric or string parameters can be handled in a similar way.

Also note that the formula automatically displays the heading in ascending sequence. Thanks to Steve Dowse of Seagate Software in Sydney for reminding us about this.

Here's a 2004 update. The original article (above) first appeared in February 2000. Now we can set a "No Upper Bound" or "No Lower Bound" on a parameter,

The formula for your date heading now looks like

if HasLowerBound ({?Date Range}) and HasUpperBound ({?Date Range}) then

"Date Range:" + ToText(Minimum({?Date Range}),"dd-MMM-yyyy") + " to " +

ToText(Maximum({?Date Range}),"dd-MMM-yyyy")

Else if HasLowerBound ({?Date Range}) then

"Date Range: After " + ToText(Minimum({?Date Range}),"dd-MMM-yyyy")

else "Date Range: Before " + ToText(Maximum({?Date Range}),"dd-MMM-yyyy")

 

This uses the new functions "HasLowerBound" and "HasUpperBound". They are available only in Crystal Reports version 9 and 10. You find them in the function list under "Ranges."

 

Another option which may work for you is to forego numbers altogether and use graphs instead. Since the purpose of a Crystal Report is to provide business intelligence rather than raw data, this is usually the better way to go.

We have a tool that can help you make extremely useful charts. It's called CR Chart.

 

This article is copyrighted by Crystalkeen, Mindconnection, and Chelsea Technologies Ltd. It may be freely copied and distributed as long as the original copyright is displayed and no modifications are made to this material. Extracts are permitted. The names Crystal Reports and Seagate Info are trademarks owned by Business Objects.

Authorship

Except where an author's name is given at the start of the article, all of these articles were written by Mo Naughton or Bruce Ferguson and edited by Mark Lamendola. Mo is a Crystal Reports consultant, trainer, and developer for Chelsea Technologies, Inc. Bruce Ferguson is a Crystal Reports consultant, trainer, and developer for CrystalKiwi, Inc. Mark Lamendola is a writer and editor with over 15 years experience in professional and trade publications.