Solved

Why is the Crystal Reports 11 SQL expression system so retarded?

Posted on 2006-06-19
6
477 Views
Last Modified: 2011-09-16
I've got a simple report that has an SQL command, joins a couple of tables, groups, and prints. Now I want to add an SQL function call from the group. (E.g. call a scalar function from SQL with two parameters, display the result in each group.)

Seems simple enough, right? Well try as I might, I can't figure it out. The one option that might be able to do this for me, "SQL expression builder", disappears as soon as you add an SQL command in the database expert. WTF? Is it punishment for not wanting to use the lame Crystal reports database linkup system?

Any suggestions appreciated! I read to try a subreport, although have been resisting so far (I'm going to want to subtotal on this function call, etc). What I really want is a crystal reports function where I enter

"run my SQL function with parameters @go, @team", that I can use like any other Crystal function.
0
Comment
Question by:TerryBurger
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 26

Accepted Solution

by:
Kurt Reinhardt earned 250 total points
ID: 16941609
1)  A SQL Expression field is conceptually the same as a subquery/subselect (either correlated or uncorrelated) in the SELECT clause of the SQL statement that Crystal generates from your datasources.  Since you're using a SQL Command object, which is a SQL statement in it's own right (conceptually the same as a Stored Procedure that you create in Crystal instead of on the DB server) there is no need for a SQL Expression field.  After all, if you can write your own SQL in a command, why do you need to refer to another field object?

2)  Since a SQL Command object is treated as a Stored Procedure, it must be executed prior to any other objects in the report in order to identify the columns that are available to it.  As such, a SQL Expression field (which is a Crystal object) wouldn't do you any good because it wouldn't be evaluated until after the SQL Command.

3) I haven't tried this, but can you compile the scalar UDF in your DB then refer to it in the SELECT statement of your Command?  Then, you'd have the ability to group on the returned field.  If you're not able to do this, then I would try building the scalar UDF as a subquery in the SELECT statement of your command...

~Kurt

0
 
LVL 23

Assisted Solution

by:Ido Millet
Ido Millet earned 250 total points
ID: 16945541
One alternatve is to use a User Function Library (UFL).  At least one of the 3rd-party UFLs listed at: http://www.kenhamady.com/bookmarks.html provides functions that allow you to run SQL expressions that return a single value or that return no value (Update, Delete, Insert).  The target database can be any ODBC DSN (doesn't have to be the same as the main data source for the report).

- Ido
0
 

Expert Comment

by:smileymahoney
ID: 36550007
does anyone know if calling functions (as requested in the original question) has gotten any easier in Crystal 2008?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36550225
As far as I know it hasn't.

mlmcc
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question