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

calling outside functions from Crystal

Status
Not open for further replies.

hhiebert

MIS
Feb 28, 2003
25
CA
Can someone tell me if it is possible to call a function from Crystal and then use that returned value in your report.

The function I want to call is created in PROBE which gets compiled into C++ code. ie. dbdate() would return the database date and bene_type(cust.benefit) would return the benefit category of a customer.

Any leads is appreciated.
 
Dear hhiebert,

When you state it is a database function, is this a SQL Server User Defined Function? If so, I have used those in SQL Expressions. If it is another db backend, then I would just give it a try in the SQL Expression and use the following as a basis for trying it out.

Here are the rules I have found:

1. There cannot be a cursor in the function.
2. Any parameters passed must be real data fields or buildable in the Sql Expression editor.
3. You need to grant execute to Public on the function.
4. You must call the function specifying the owner.

Otherwise, it works great. Here is a syntax example:

(dbo.mycusomtudf('FieldusedasParameter')

Hope that helps you,

ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
You'd need to create a UFL to accomplish this I think.

I've only used VB to do this, check the crystaldecisions site.

-k
 
Ahhh, good point, Ro, I hadn't considered that it was all database based.

They may even be able to use a Function from within the database to do this, as opposed to external code.

However if you have a piece of C++ code tyou need to get to, you may be able to convert it to a proper format for CR, or write a UFL that accesses it.

-k
 
Thanks both Rosemary and vampire for your feedback. I'll look into both options.

hh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top