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!

Present user with choice of usable parameters

Status
Not open for further replies.

butkus

MIS
Sep 4, 2001
114
US
I have an established report which is running well (over Crystal Enterprise). It has been mentioned that an alternative parameter would be useful to get to the same information (and I agree). How then do I establish the second parameter and present the user with the choice?

FYI... The report runs in a prosecutor office and is used to generate letters to the victims of crime. The database stores victim information and assigns a unique victim number (which is the existing parameter) for each entry. Further, the database captures the case number (which is what I would like to use as the second parameter).

Can this functionality be handled in a formula?

I'm using CR 8.5 dev
 
It sounds like you need to add another parameter, then the user can enter into either one, or both, your logic in the record selection criteria would be something like:

(
if {?MyCaseParm} <> &quot;&quot; then
{MyTable.MyCase} = {?MyCaseParm}
else
if {?MyCaseParm} = &quot;&quot; then
true
)

and

(
if {?MyVictimParm} <> &quot;&quot; then
{MyTable.MyVictim} = {?MyVictimParm}
else
if {?MyVictimParm} = &quot;&quot; then
true
)

Note that the if statements are intentionally constructed this way to try to get CR to pass through the SQL (increase performance).

If you intend to allow multiple selections:

(
if {?MyCaseParm}[1] <> &quot;&quot; then
{MyTable.MyCase} in {?MyCaseParm}
else
if {?MyCaseParm}[1] = &quot;&quot; then
true
)

...

-k kai@informeddatadecisions.com
 
I don't really know what you mean by an 'alternative parameter'.

Do you basically mean two parameters on the same report, but only one needs to be filled?

Because you can achieve this by assigning default values to both of them.

If you mean a dynamic appearance of parameters depending on the user id or something, that's not really going to be a do-able thing.

Naith
 
{MyTable.MyCase} like {?MyCaseParm} and
{MyTable.MyVictim} like {?MyVictimParm}

Make sure that the default parameter value in each case is '*'. This record selection criteria will be passed to the database.
 
Thanks everyone, this has solved part of the problem. While the report runs as it should in Crystal Reports 8.5's application environment. (The user can select which Parameter they want in order to drive the report).

When published to Crystal Enterprise, the user is presented with the Victim Number parameter first, the Case Number parameter second. While only one parameter is needed to run the report. I was hoping CE would allow the user to decide before hand which parameter to use rather than provide a place for both parameters to be populated.

Any additional ideas would be greatly appreciated.

James
 
Without using a custom CSP page (or some external process) to select which parameter to use, and then obtaining the parameter (which is still 2 parameters, though you could display them on a single page), I don't think that you can do this.

The code I'd supplied doesn't require that they enter anything into either parameter (it will return everything if neither is entered), so they can just click right on by...

Shouldn't be too confusing for the users, especially if you add appropriate prompting text.

-k kai@informeddatadecisions.com
 
K,
You don't know my users. I think your right though - It will just have to be a training issue. Thanks for the input.

James
 
I'm just a user of development tools, and my confusion is demonstrated as boundless daily.

An additional thought is to prepopulate the parameter picklist with an 'All' or some such, which can help to clairfy the intent for your users.

Then just resolve whether they left an 'All' type of choice in your record selection criteria and do nothing in that event.

Seems to help.

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top