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

Javascript eval function equivalent in Crystal Report 10

Status
Not open for further replies.

bether

Programmer
Jan 3, 2007
28
US
Does CR10 have an equivalent for the javascript eval function. This takes a string argument and return its value.

I'm building a report where the user specifies the fields they want to be included in the report. The columns/fields are not known at design-time. At runtime, I take the column name in a string variable, and will have to get the column value. How can I get the column/field value, given only the name?

Thanks!
 
You should qualify this a bit more.

Do you mean that the user will use parameters to determine which fields are returned?

Crystal isn't brilliant with ad hoc reporting from a users standpoint, but you can code it as in:

if {?MyParameterChoice} = "City" then
{table.city}
else
if {?MyParameterChoice} = "State" then
{table.state}
else
if {?MyParameterChoice} = "Zip" then
{table.zip}

Crystal doesn't allow for pass through of a value and then display the value of the column of the same name. In fact, you need to return the same data type or convert it within a formula to the same type.

-k

 
Thanks!! Yes, I failed to mention that user will use parameters to determine the fields.

This works. Just thought there's an "eval" like function.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top