Solved

Crystal Performance - Stored Procedures vs Datasets

Posted on 2006-06-08
8
996 Views
Last Modified: 2008-02-01
We have a web application that produces PDF formated reports.
Currently we use .NET datasets to pass the data into Crystal reports in real time.
These can be large and some reports take sveral hours to run (1500+ records) where there are multiple subreports embedded. At time it crashes the server altogether, chewing up resources.
We are trying to come up with a way to delay the report running to a time where server usage is low eg; (9pm)
If I use stored procedures as the datasources in my reports, and pass the parameters out of a database (where they are stored until time allows the report to be run) does this create performance issues. One report may access 5 stored procedures for each record... therefore 7500 calls on a large report.

I want to know if this is faster, slower...or a stupid way of addressing our issue.
Any input is appreciated...though please dont give generic links to examples.
0
Comment
Question by:Milkus1
  • 2
  • 2
  • 2
  • +2
8 Comments
 
LVL 10

Assisted Solution

by:Spykair
Spykair earned 50 total points
ID: 16867535
>One report may access 5 stored procedures for each record... therefore 7500 calls on a large report.
I know that a report can only have one SP as a datasource. I assume that the other 4 SP's are called from subreports. Subreports will definitely have an influence on the performance of your report. The more subreports you have, the slower your report will run.

Spykair
0
 
LVL 42

Accepted Solution

by:
frodoman earned 350 total points
ID: 16869512
It sounds like you're calling multiple subreports for each record on your report, is that correct?  If so, then I don't think you'll see any performance gain by moving to stored procedures (it might even slow down a little because of the initialization time).

With a report structured this way, almost certainly the bulk of the time is within Crystal itself so changing the datasource isn't going to have a significant impact.  If you really want to boost performance, look for a way that you can eliminate some of the subreports.  One suggestion to look at would be if you can return some of the data being pulled in the subreports with your main dataset (this is where a stored procedure might help by enabling you to do this).  Although this often means some duplicate data gets sent in, it may be much more efficient than 7500 subreport calls.

frodoman
0
 
LVL 26

Assisted Solution

by:Kurt Reinhardt
Kurt Reinhardt earned 50 total points
ID: 16870909
frodoman and spykair offer good advice.  Subreports can be useful, but they can also be very detrimental.  For example, a subreport makes a call to the database once for every occurence of the section in which it is housed.  For example, if a subreport is in the Report Header, it will make one call to the db.  If it is in the Page Header, it will make one pass for every page in the report.  If it is in the detail section, then it will make one pass for every detail record returned - if there are 50,000 records returned, it will make 50,000 passes to the database.  Obviously, this isn't ideal.

Before you consider changing from a .NET dataset to a stored procedure, I would suggest you analyze the actual report requirements and design and see if there's a better way to gather and return the data.  As frodoman stated, stored procedures can help to eliminate the need for subreports.  Additionally, if you simply need to return a single value and you're using a subreport to get it, a SQL Expression field might help.

~Kurt
0
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 50 total points
ID: 16874645
Agree.  The report will probably run better if run when the server has less load but it will still use similar amounts of resources it just won't be competing for them.

The stored procedure should run fatser since but as pointed out by frodoman, the gain will be outweighed by the complexity of the report and the number of calls.

mlmcc
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:Milkus1
ID: 16883387
All good advice, thankyou. Point splitting looks likely ;0)

If it helps the report produces a list of applicants for a particular hospital for various positions.
So the report is grouped by 'Position' and inside each applicant's details is subreports for

1.List of qualifications (0...5 records)
2. List of previous employment (0...10 records)
3. List of preferences for positions (1-5 records)
4. List of referees (3 records)
5. List of referee replies (3 records)

These are also accompanied by up to 100 other fields eg : surname, DOB, etc

What would be the recommended approach, based on the fact there may be 1500+ applicants.



0
 
LVL 42

Expert Comment

by:frodoman
ID: 16884703
It's difficult to say the 'best' approach w/out being in your shoes.  One thing I would consider doing is to make all of the applicant's details a single subreport.  Create a stored procedure that returns for every employee a single record structured like this:

Qualification1, Qualification2, Qualification3, Qualification4, Qualification5, PrevEmploy1, PrevEmploy2, ... etc.

Have your SP return empty strings or even a single space character for any field w/out data so you're always getting back the same fields, even if nothing is in them.  You can then layout your subreport with a very large details section and arrange all of these fields however you want to see them.  This gives you all of the same data but only 1 subreport per employee - as long as the SP is efficient this will be a tremendous improvement.

You might also consider making this subreport "on-demand" so it only runs if you're interested in this person and click on their name.  I don't know though if that makes sense for your situation.

HTH

frodoman
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 16938815
Glad i could help

mlmcc
0
 
LVL 10

Expert Comment

by:Spykair
ID: 16939762
Glad to help.

Spykair
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now