Crystal Viewer Print Locking

Posted on 2007-08-09
Last Modified: 2010-04-23
Good Morning


I have a customer that is experiencing issues with locking up while printing reports via Crystal around the same time each day.  Preliminary thinking would lead us to perhaps "something" on their system causing a problem at the same time each day.  But, I want to throw the idea out, that perhaps repeated printing out of my applicaiton all day kind of takes a toll by afternoon.  

The application is  I basically use the ReportDocument and attach it to the CrystalReportViewer object to print.  Here is the code:

 'Attach ReportDocument to CrystalViewer object
 Prt_ShowReport.CrystalReportViewer.ReportSource = LBSI_ShowReport.RD

Do I have to do "something" here to release the resources after each use?  Could repeated use of this code, without closing the application, possbily cause a problem?

I welcome questions to assist with what other information maybe needed to diagnose the issue.

Question by:Jimbo99999
    LVL 42

    Expert Comment

    I think it's much more likely something on their system or network causing the problem.  Potentially if your application is running all day and you repeatedly create ReportDocument objects without disposing of them or releasing them for garbage collection that it is remotely possible that this could be the cause of the problem.  I believe it extraordinarily unlikely however that even is this were the case that it would occur at the same time every day...

    Author Comment


    I agree with you there.  As a precaution, is this something that I can release or reset before each use?

    Kind of like making sure all our ducks are in a row...

    LVL 42

    Accepted Solution

    You can make sure that you dispose your ReportDocument object after it isn't needed any longer.  This should be happening anyway due to routine garbage collection unless your application doesn't have any subs and is one long block of continuously looping code.

    The viewer shouldn't be a problem because it looks like you have a single viewer and just assign different sources to it.  If you are creating a new viewer every time then make sure you dispose of it also.

    Author Comment

    Thanks for the help...


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    794 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

    16 Experts available now in Live!

    Get 1:1 Help Now