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!

parameters and database lookups 2

Status
Not open for further replies.

wiplash

MIS
Jun 29, 2004
99
US
I have a parameter the user enters (as they know it), however the database actually contains a somewhat different acronym. (same length) Can I convert their entry and then do the lookup using the conversion? By the way, we're using Crystal Reports 10 only. No VB or other frontend.
 
Hi,

Can you not just set up the parameter defaults this way?

When prompted your user would select from a list of "friendly names" however the database value would be passed.


Nuffsaid.
"This Week, We're Stampeding!!
 
Maybe I'm not following you, but if I set the parameter default to "ABC", the report looks for "ABC" in the table. The value in the table is "DEF". In other words, the user would select from the default, which would be "ABC". How do I get the report to look for "DEF"?
 
Is there a database table that matches both values? What kind of logic relates the two value sets?
 
Hi,

Ok let me clarify, edit your parameter, and select the “default values” option.
Enter the database values as the default values. Once this is done highlight one of the default values in the list and click the “set description” option. Enter you user’s friendly name as the description. Do this for all default values. Once complete select the “Description” option from the display dropdown box. When your user is prompted he / she can pick from a list of friendly names however the associated default value will be passed to the database. Using your example the user would select ABC but DEF would get passed.


Nuffsaid.
"This Week, We're Stampeding!!
 
Thanks! I didn't realize the "display" option was even there. Works fine now!
 
Following up, even though Crystal Reports displays just the "user friendly" name, Crystal Enterprise displays both the "user friendly" name along side the actual value. Can this "value" be removed from the display?
 
Can you change your Viewer to ActiveX (then you only get the description).

IIRC the DHTML viewer parameter screen comes directly from the WCS so you can't hack the code.

Kingfisher
 
I would guess that is the ePortfolio piece of CEnterprise that displays both values, not the viewer. ePortfolio can be edited. That would be in schedule.csp. Maybe tomorrow I can look at the code to see where it is getting both pieces of the parameter display.
 
Certainly if you are Scheduling the report then you could modify rptschedule.csp (this is the v10 name). There is a block that you can modify that starts:
// DISPLAY THE CURRENT VALUES SELECT BOX

The problem I saw was when you View and have prompt for parameters on - I don't this there is an equivalent script to modify, I think it comes straight from viewrpt.cwr (i.e. WCS) I could be wrong.

However If you uncheck "allow editing of default values..." in CR then the Value goes away just leaving the Description.
I don't understand why you have to have multiple values to check / uncheck this box though?

Anyway the short answer is yes it can be removed, but it's not very intuitive!

Kingfisher
 
Thanks for everyone's help! The advice Kingfisher gave to simply uncheck "allow editing of default values" worked like a charm. The "user friendly" value is there all alone which is just what we wanted, so thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top