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

How to create a Function?

Status
Not open for further replies.

bandarna

Programmer
Jan 2, 2003
122
US
Hi
I am kind of new to CR.
I want to use one of the fields (vouchr_item.element_1) from my report and get the description field from another table (elem_desc.element_desc). These tables not connected with 1 to M relation.

I want use a function and return the element_desc. Can anyone help me how to do this?

-nb
 

Functions in CR have to be independent of any database, so I don't think that will work for what you describe. You could create the function within your database, though.

Can you write a SQL statement that will result in a dataset that can be joined? Something like:

select elementnumber, element_desc from elem_desc where something something...

If so, you would create a command object in Crystal (Database Expert --> Add Command) and then join it as you would any other table.

It seems odd that the element description table cannot be joined to the vouchr_item table.



 
If all else fails, you can access separately using a Subreport. Slows processing if done at detail-line level.

If you don't already know subreports, learning about them will pay off. (Likewise Crosstabs, which are not relevant for your issue but do often come in useful.)

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 2008 with SQL and Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top