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

Range Parameter - Default Values

Status
Not open for further replies.

techie2

Programmer
Jul 28, 2004
180
US
Hi,

Using CR8.5, CE 8.5, Oracle 8i.

I have a report with number and string range set. I have set the option to "Both Discrete and Range Values".

Everything is working fine till this point.

Now, I want to add number range 1 to 99999 and string range '1' to '99999' as part of default values so that users don't to change anything if they want to run the report for these ranges.

How to do this. I don't see any option which would let me set these ranges as default ranges.

Thanks in advance.

V
 
As far as I know 8.5 only allows for default values that apply to both the beginning and ending values of the range, not seperate values for beginning and seperate values for ending. I believe this problem was resolved in vers 9.
You could create seperate parameters for beginning and end values.
MrBill
 
A different approach might suit you better anyway.

Set a default value of 0, and prepopulate the value with 0, making sure that you turn on the description and populate the description with "select 0 for all"

Now in the Report->edit select formula->record place something like the following:

(
if minimum({?MyNumberRange}) <> 0 then
{table.field} in {?MyNumberRange}
else
if minimum({?MyNumberRange}) = 0 then
true
)

Now the user gets a friendly prompt, and if they select the current prepopulated value of 0, no filtering will be passed to the database (more efficient than sending all values), otherwise if they enter values, they will get the range entered.

For a string use:

(
if minimum({?MyStringRange}) <> "0" then
{table.field} in {?MyNumberRange}
else
if minimum({?MyStringRange}) = "0" then
true
)

Note that the else if fully qualified and the parenthesis are important to ensure sql pass through.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top