Report Design
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Report Design
Message Icon Topic: Using a user-defined function in a Crystal report Post Reply Post New Topic
Author Message
gabby
Newbie
Newbie
Avatar

Joined: 28 Aug 2007
Location: United States
Online Status: Offline
Posts: 1
Quote gabby Replybullet Topic: Using a user-defined function in a Crystal report
    Posted: 28 Aug 2007 at 4:21pm

To understand what I am asking, suppose I have a table named Orders that has a Create_date field and the database also has a dbo.ssWEEKBEG user-defined function that I want to apply to it. I am creating a Crystal Reports Viewer object that will display the results of Create_date and dbo.ssWEEKBEG(Create_date).

Am I required to create a view that includes the results of  dbo.ssWEEKBEG(Create_date) as one of the views?

Is it possible to call the dbo.ssWEEKBEG function from within the report?

I have verified that I am unable to add dbo.ssWEEKBEG(Create_date) to the data selected for the report.

Also, once I set up the data to use in the report, can I edit the SQL statement that Crystal uses?

"Aim high. You may miss, but at least you won't shoot your foot off." - Lois McMaster Bujold
IP IP Logged
jkwrpc
Senior Member
Senior Member


Joined: 19 Jun 2007
Location: United States
Online Status: Offline
Posts: 432
Quote jkwrpc Replybullet Posted: 28 Aug 2007 at 5:57pm
Once again I am not on ground I know.  However, I do understand you can create your CR against a stored procedure. That being the case can you not run your user function from through execution of a stored proc.
 
The discussion of stored proc is in CR help under ' stored procedures '
 
Regards,
 
John W.
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 28 Aug 2007 at 8:38pm
I'm with John on this one. I haven't called a custom SQL function either, but I would use a command object and put it in the SELECT statement. Of course, putting it in a stored procedure also works.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 28 Aug 2007 at 8:39pm
Oh yeah - you can't edit the SQL that CR creates. But you can use a command object to write it yourself.
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.031 seconds.