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!

Hey you 'Experts' out there - Solve this one

Status
Not open for further replies.

ggeorgiou

Programmer
Oct 19, 2001
12
CY
Anybody knows how I can access the default value description of a parameter?

I can get the type of the parameter, name, default value but not the description because I can't find any such property.

If there is no such property, how does Crystal Decisions do it?

George Georgiou
 
I am not following what you mean by "default value description"
 
I assume you are interrogating this via Visual Basic and the RDC, because any other approach doesn't make sense.

If you are using the OCX, then these can't be interrogated, but they are available if you upgrade to using the RDC.

The property you are looking for is
NthValueDescription(index As Integer)

it works in conjunction with
NumberOfDefaultValues and
GetNthDefaultValue(index As Integer)


Editor and Publisher of Crystal Clear
 
Bruce,

What if you are not using RDC, how can these values be added to a crystal report?

Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
I'm not sure this is what you're looking for, but...
For a display of parameter value descriptions, you can create a text file in Wordpad (e.g., saved as "Picklist"), and then in the set default values screen, click on export pick list. Then run Wordpad and open up "Picklist." Be sure you have the display set for "value and description."

You don't say how you want to use the description. If you want to be able to use the description in the report, you might have to create a formula in the report that recreates the description display, e.g., {@Co) for {?Co}:

select {Co}
case "1234": "Ford"
case "1235": "Chevrolet"
default : "Other"

I apologize if what you were looking for was something much more sophisticated than this!

-LB
 
The parameter default descriptions aren't available to you inside CR. But if there is a logical way to build the original list, then you use the same logic inside the report.

example one:
Your parameter is a list of customer codes, with a description of their customer names. So do a join to the customer table, and extract the selected customers there.

example two:
Your parameter is one of several code values in a field. So manually code the descriptions in a formula.
If {table.code}=1 then "Active" else
If {table.code}=2 then "Inactive" else
If {table.code}=3 then "Deleted" else
Else "Undefined"

All Cr uses the parameter descriptions for is to help the user make a selection prior to processing the report. It is the parameter value that is used inside the report (usually in record selection).

If you have 60 default values and descriptions, you can only find the value and description of the ones you select into the report. The unused values aren't available to you inside CR at all.

Editor and Publisher of Crystal Clear
 
Sorry for not be very clear in my initial posting of the problem.

I am using VB.net and I want to use the new CrystalReportViewer that comes with CR 9 in order to view reports already developed using CR 9 development system.

However CrystalReportViewer in contrast to CRviewer and CRviewer9 has an absolutely stupid Parameter dialog where you have to go through each parameter one by one via the NEXT button, instead of being able to pick and choose which parameter you want to change the default value, as is the case with CRviewer and CRviewer9. Naturally, in any parameter dialog that you write, you want to show to the user the default values and the description for each default value, that the developer of the report specified originally.

This is my problem because via the ReportDocument class I can get at all the information i need about the parameters apart from the description that is associated with each default value.

George Georgiou
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top