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

BYPASS Parameters 2

Status
Not open for further replies.

BoeingSK

Technical User
Nov 2, 2007
36
0
0
US
My question is how do we Bypass parameters. I have a report that I added a parameter to search for document numbers. The user can search for one document or a range of numbers.
What I don't know is how to bypass the parameter and just let the whole document flow. It won't let you hit O.K. on the parameter without entering something. When you hit cancel then it doesn't refresh at all.

Up and Coming Technical Guy
 
is your parameter field setup as a range value or is it setup to allow multiple values but not a range?

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Settings are Custom-true, multiple-false, discrete-False, ranges-true

Up and Coming Technical Guy
 
In the parameter setup you could enter a default value of All. Then use a formula like this in your selection

if {?Pool(s)} <> "All" then
{@campaign} ={?Pool(s)}
else if {?Pool(s)} = "All" then true

Note: Those are my fields, you will have to replace for yours

When you run this report for a specific range the user will have to remove the All. If you dont save data with report, the next time you run the report it will default to report on the entire range.


_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Set a default of 0 and then write your selection formula like this:

if {?parm} <> 0 then
{table.number} = {?parm} else
if {?parm} = 0 then
true

This is the same thing as CoSpringsGuy was suggesting, but based on a numeric range parameter.

-LB
 
Thanks Cospringsguy and Lbass that worked for my number parameter, but what would be the default for a parameter that searches by date or a non numeric string.
I tried the same thing on a date parameter and it would take the 0.

Up and Coming Technical Guy
 
Non numeric would be the suggestion I had above. LBass appropriately corrected it to numeric for your purpose. I have never tried with a date parameter but I would assume you could use the same premis.

OK I had to try it before I posted...
a date range parameter does not give you a minimum and a maximum. so if you enter a default date it appears in both the starting and the ending when you try to run. So my thoughts, if you ever needed this, would be create 2 paramaters startdate and enddate. Enter a default for each and create a formula similar to the one for above.

Im not sure if you were just asking a general question or if you actually need to know this for a current project. If you need to know now and cant get there from the info I posted let me know and I will try to work it out....

_____________________________________
Crystal Reports XI Developer Version
Intersystems Cache 5.X ODBC connection

 
Thanks anyway for your help, I figured it out on the date I can just put No lower value and todays date. This should all be enough for me to play with. Thank you>

Up and Coming Technical Guy
 
I was reading this with interest, as I need to put default dates (actually, don't have to, it would just be nice) for users for running reports.

But I run my reports through enterprise, and the solutions being discussed above don't seem to work. Despite setting default start and end dates to date(1901,1,1), and then saying

{RESOURCE_BOOKINGS.RESOURCE_TYPE_ID} = 1.00 and
{@PostCode} in (UpperCase ({?Start PCode}) to UpperCase ({?End PCode})) and
(if {?Start Date} = date(1901,1,1) then {?Start Date} = (CurrentDate-90) and
if {?End Date} = date(1901,1,1) then {?End Date} = currentdate) and
{RESOURCE_BOOKINGS.DATE_ADDED} in ({?Start Date} to {?End Date})

It doesn't work in crystal or enterprise. Any ideas?

 
That should be:

{RESOURCE_BOOKINGS.RESOURCE_TYPE_ID} = 1.00 and
{@PostCode} in (UpperCase ({?Start PCode}) to UpperCase ({?End PCode})) and
(
if {?Start Date} = date(1901,1,1) then
{RESOURCE_BOOKINGS.DATE_ADDED} >= CurrentDate-90 else
if {?Start Date} <> date(1901,1,1) then
{RESOURCE_BOOKINGS.DATE_ADDED} >= Currentdate
) and
(
if {?End Date} = date(1901,1,1) then
{RESOURCE_BOOKINGS.DATE_ADDED} < currentdate + 1 else
if {?End Date} <> date(1901,1,1) then
{RESOURCE_BOOKINGS.DATE_ADDED} < {?End Date} + 1
)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top