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!

Dynamically Select a field to use within the report

Status
Not open for further replies.

M8KWR

Programmer
Aug 18, 2004
864
GB
I have got a parameter field which the user is able to put a value in eg 020.

What i would like to do is use this value in order to select a field on the report.

So the report would show U020.

If U020 does not existing then it would default to U999 for example.

I hope all of this makes sense. I'm unsure if you are able to do this type of function within Crystal report, many thanks for any help in advance.

 
Please provide the version you are using.
If it is version 9 or 10 try this
create a formula like this with the parameter:
IF ?param in {field} then {field}
ELSE 'U999'
and create a record selection formula as
{field}=formula
I have not tried this out, so not sure whether this will work. Please try the same and reply.

Thanks,
Madhu
 
I have done this to try and build the field i require.

Local StringVar x;
Local StringVar Y;
x := {?Campaign Code};
y := "{CONTACT2.UCAMP" + x + "}";


I do not know how to check whether the field exist in the table already, and if it does to default to a field that i know exists....


I am using Crystal 9/10 - if that helps.
 
What do you mean "Select a field on a report"? Do you mean you want to select specific records based on one specific field containing "020"?

Software Sales, Training, Implementation and Support for Macola, eSynergy, and Crystal Reports

"What version of URGENT!!! are you using?
 
In the simpliest of forms, lets say i want to display 1 field on a report, and gave the user a parameter to enter a value.

The value been entered into the parameter would be 001, 002 003, 004 etc.

I want to take this value and select the field that is display.

The fields i would like displayed would be contact2.ucamp001, contact2.ucamp002, contact2.ucamp003 etc

But if one of the fields does not exist then as default i would like contact1.source displayed.

I hope this makes more sense.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top