?
Solved

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

Posted on 2006-06-19
6
Medium Priority
?
478 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 1000 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 1000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

762 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