Crystal Reports slow when creating ReportDocument and loading report

Hi Experts,

I have created serveral crystal reports (in version 2008) and a single C# console application in VS2008 which basically creates the ReportDocument object, loads the report and either exports or prints it.

CrystalDecisions.CrystalReports.Engine.ReportDocument rptDoc = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
rptDoc.Load(sParamDOC); //sParamDOC being the report name to process passed in via command line argument

Open in new window

On a server (windows server 2003) that is only accessed via remote desktop connection I have installed crystal reports redist 3.3 and copied the program and reports over. Everything was working great.

I discovered that when the users ran my program it was taking a long time to execute. I put in some code to debug where the performance hit was and realised that when I logged in and ran the program it runs everything in a reasonable time (less than 20 secs), creating the ReportDocument and loading the report takes seconds and the rest of the time is processing the report.

When anybody else logs in it takes about 1 minute to create the ReportDocument and another minute to load the document then continues to take longer to process the report. Times do vary a little but I've seen it take up to 4+ minutes.

I first assumed it had something to do with security as I'm an administrator so I created a fake user giving it admin priviledges and it still runs slow logged in with this user. It only seems to be quick for me.

I also tried changing the security mode of terminal services to 'relaxed security' as it is being called from an old legacy app. This has no effect either.

I've tried posting on the SAP Crystal Report forum but haven't had a reply from them.

I hope somebody can give me some pointers as where to look next because I feel a little stuck at the moment.

LVL 10
Who is Participating?
gavsmithConnect With a Mentor Author Commented:
I figured it out! It turns out the reason it's slower for all the other users is... 'they can't access the internet'! Not that my application access's the internet (not directly anyway).

I used Sysinternal's Process Explorer to dig into which dll's were loading slowly and noticed Crypt32.dll taking some time. After doing some more searching I came across this blog:

The dll's are digitally signed and it's automatically trying to trying to verify itself via the internet. So I included an app.config file including the '<generatePublisherEvidence enabled="false"/>' tag mentioned in the blog and it fixed the problem.

Thank you for your suggestions
mlmccConnect With a Mentor Commented:
Did you log in from the same machine?

Are you logging in the same way a regular user does?

gavsmithAuthor Commented:
Hi mlmcc

While I was running the tests with the new user I setup with admin priviledges, I was using the same laptop to login via remote desktop. And I was logging in the same way yet still seing the large performance difference.

While I was doing my tests with my login details and new user I was logging in to see the desktop, however regular user's have their .rdp set to run the program straight away (so they don't see the desktop).

Just thought of one thing!!... a difference between me and the others is that at some point I would have logged in at the console and the others wouldn't. I'll test that to see if it makes a difference and let you know.

Anything else you could suggest would be great though.

Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

gavsmithAuthor Commented:
I tried the same test running on the console instead of remote desktop and get the same results:

Logged in as me:

 Logged in as me
Logged in as a newly setup administrator:

 Logged in as other admin
As you can see logged in as me it takes 3 seconds to create the object, load the report and setup the export options. Logged in as somebody else this process takes 1min 2secs which is a big difference.
I wonder if there is some kind of caching going on.

gavsmithAuthor Commented:
Interesting idea, it's out of hours so I have restarted the server and tried again (in theory nothing should be cached because of the restart) logging in using my credentials it did take longer on first run (7secs to create object, a further 12secs to load report - 19secs total) however second run was back to being fast again (4secs for both).

Logged in as other user, first run it took 41 secs to create object and 36 secs to load. second run it took 35 secs to create object and 36 secs to load report.

If it was a caching problem I would expect all users to be creating the object and loading the report in around 19secs like my first run. I have a feeling the problem is something deeper within windows server 2003 but I don't know what.
I am at a loss but thought that might be an issue.

Any chance there is a upped priority for your administrator jobs?

Have you logged in as a normal user on your machine?

There is no need to award points for effort.

gavsmithAuthor Commented:
I've awarded some points for trying to help. thanks again
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.