alternatively, you can turn your sql into a stored procedure, and then let the crystal report call the SQL from there.
Main Topics
Browse All TopicsI have created a report that includes a command item for a dynamic LOV, several tables, and two Views. I am not utilizing any subreports and all items appear in one detail section. I cannot figure out why my report takes SOOO long to run. If I run the query from SQL it returns results in about 2 seconds.; however, the report takes approx 5 or more minutes to complete. Crystal Reports will often stop responding while the report is running.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
I am not doing any grouping which is probably why the Database -> perform grouping on server option is greyed out.
My command object is pretty simple and only returns about 5 records. Would it still help to turn that into an SP? Should I convert my SQL Views into SPs also? Is that better for performance reasons?
I consider Crystal a fairly robust product and I don't think there is so much formatting that it would have this affect, but maybe I am wrong. If this helps, here is the result of the Database -> Show SQL query option attached.
There a few things that have a bearing on report performance. A big one is TABLE INDEXING..make sure ALL tabel are indexed correctly.
Also, from what I can see you are using TEXT in your WHERE clause..here:
WHERE "ca_resource_class"."name"
IF you have ID's for these to use instead of TEXT ..that should helpout tremendously.
One thing that is strange to me is the 2 seconds runtime vs 5 minutes.....this leads me to believe that you have a DATASOURCE configuration issue. How is your datasource setup / configured on your workstation? This actually may be the whole issue....what type of datasource are you using..?
The text in the query is the result of the two parameter selections. The first (ITIL Service) is from the command I have and the second is from a static parameter with two options (Active and Inactive). I don't want to show the id to the person running the report so that is why the names are used.
I have been using this datasource forever and don't have this problem with other reports. I am using an ODBC connection to a SQL 2005 database via Windows authentication.
The first dynamic LOV is using the following command and returns 7 rows. I do not have the command object linked to any of my other tables/views:
select name from ca_resource_class where family_id=602 AND inactive=0
The second is a static parameter that presents two selections: Active/Inactive
Be back about the views - wanted to let you look these over first.
DATABASE EXPERT >> RIGHTCLICK ON COMMAND to EDIT IT...
THEN copy paste my SQL there...I thought you said you where using a COMMAND....if you are then this is how you copy/paste it.
If you are using TABLES and linking them....then you may need to test in a TOTALLY new report...configured as much like your original as possible. May be too much trouble to test if you aren't using a command...
You don't need to convert all of your Views and what not, but if it's only taking 2 seconds or so on SQL you can call the views from a stored procedure.
The differences can be found in this article:
http://databases.aspfaq.co
Business Accounts
Answer for Membership
by: CRXIuser2005Posted on 2009-03-10 at 14:12:51ID: 23851468
Check your GROUPING ...make sure to PERFORM GROUPING ON SERVER...in the options
Also,...if you can move your SQL into a Stored Procedure and call the Stored Proc from Crystal COMMAND line that may help too...
Let me ask you...ONCE the data is pulled into Crystal...does Crystal have to do alot of calculations and formatting..or is Crystal just Displaying the reporting data....for the most part...????