cancel
Showing results for 
Search instead for 
Did you mean: 

ReportDocument.Close() hangs indefinitely

Former Member
0 Kudos

Recently, a program we run has started to hang on the Close method of crystal reports. The program interates through all our reports and converts all ODBC references to OleDB, then saves the report if a change has occured. This is done without opening crystal reports itself, this is done automatically on each Sunday to keep all our report documents correctly aligned. Unfortunately, two weeks ago this behavior started where everything processes fine, but once the Close method is hit it hangs indefinitely on any report we open. Once it is open, it never closes and we end up arriving on Monday with a machine hanging on the first report it attempted to process. This means it has run for hours with no result, the Close process never finishes.

I've searched the internet for the past two days on this issue, and I've found a number of different results. None of them exactly fit what is happening in our environment, but I've tried them all nonetheless and with no success. I can't use Dispose because it also uses a Close method as well. I can't use GC.Collect because that process in not only slow, but is never reached since the program hangs on Close. I've examined the CRUFLs and have not found any problems. We are using internationalized resources though, but we've been using them for quite some time without an issue. Everything runs as x86, so that isn't a problem. I could go on, but I've tried more things than I can remember.

We did recently move to VS 2013 (though it was working even with that two weeks ago). I'm at my wit's end here, I can't decipher why this is happening. Has anyone else had an issue with the Close method hanging indefinitely, and is there a solution for this? Let me know what you may need from me.

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello,

None of our runtime is supported on VS 2013 yet. CR for VS Service Pack 9 will once it's released in a month or so...

For now all I can suggest is possibly wrapping all CR API's in a try/catch and add logging to your app to see which API's it's hanging on, it could be something else is failing and not being handle properly so the close method hangs... Maybe the report did not even load....

Don

Former Member
0 Kudos

Don,

Thanks for the reply. Though we have VS 2013 installed, we still use VS 2012 for our crystal reports (and for the compile). I've wrapped everything in try/catch statements, run fusion logger and have not seen any assembly issues. The document loads, as we do some processing along the way, as well as report logging (including more while debugging this issue). I've also run this through VS 2012 debugger and the process just hangs on the Close method without ever creating an error. I've looked extensively in the event viewer and have not seen any strange activity, or errors for the application. I've just pulled in procmon and will investigate further with debugdiag, as neither were on the machine in question.

I should explain a bit, this is happening on our build machine, which has worked fine for the crystal reports converter for months. It just started hanging two weeks ago with no major changes in code or the environment. The stranger thing is, I have exactly the same development environment on my own company machine and I can't replicate it, that is, everything works fine on my machine (the 'song' of the developer). Anyways, I have tried as much as I can reasonably try within the limitations of my knowledge of crystal reports (which I admit, isn't deep). The internet has been a great resource on this issue, but I haven't found any result that has solved our issue, while this is the closest to our problem . Unfortunately, I wasn't able to see any resolution from this either, so I'm kind of stuck.

0 Kudos

Hi Kendall,

See if crpe logging will capture anything or at least how far it gets, you have to search for this one, link likely won't work:

1470978 - How to enable/disable crpe logging for the Crystal Reports .NET SDK

I'm wondering if some MS Kbase patch broke permissions on something. That other forum post never went anywhere, not sure if the guy figured it out or not... Possibly reply to it and ask.

I've seen/had this happen to me on my PC at various times, although not recently, and a few others had weird issues like the MS Office installer starting up when ever CR runtime was called. I/We never did figure it out, it just "started working" again after a reboot or some update to something. It's been a while since this has happened to me so I don't recall what I did. May have just come back from the weekend and it started to work.

I think it was in the initializers of the main app, possibly around the load/unload methods of the CR dll's or dependencies... Which may suggest a sharing violation or permission issue, possibly a dll is locked???

Are you threading in your app or handling each print job sequentially?

See what crpe logging shows or where it ends...

Don

Former Member
0 Kudos

Found the problem, appears that Crystal Translator has a CRUFLCT2.dll that was causing the issue for Crystal Reports for VS. Since we don't use that UFL, we were able to ignore it and everything is back to running smoothly. Thanks once again for your help Don.

0 Kudos

Ah, good to know a third party UFL dll was the cause of the issue.

If you are using it I suggest you post to their site the issue they are causing...

Thanks for the info.

Don

Former Member
0 Kudos

Hi Kendall

We have the same problem at the moment. How did you exactly manage to ignore the CRUFL Library?

Thanks

0 Kudos

Hi Sandro,

If you check the formula collection the catch will display the name of the ufl missing:

foreach (FormulaField resultField in rptClientDoc.DataDefController.DataDefinition.FormulaFields)
{
    String FormulaMessage;
    textBox1 = resultField.LongName.ToString();
    btnReportObjects.Text += textBox1;
    btnReportObjects.AppendText(" : Used: " + resultField.UseCount.ToString() + " times'End' \n");
    try
    {
        FormulaMessage = rptClientDoc.DataDefController.FormulaFieldController.Check(resultField);
    }
    catch (Exception ex)
    {
        btnReportObjects.Text += "\n" + ex.Message + "\n";
        FormulaMessage = "";
    }

    if (FormulaMessage != null)
    {
        btnReportObjects.Text += FormulaMessage.ToString() + "\n";
    }
}

btnReportObjects is just a text box.

rptClientDoc is the Report object for RAS ReportClientDocument.

This returns something like this:

'UFLFunctionName ({@UFLFormula},"Name" , "I")

'

UFL 'u2lDon.dll' that implements this function is missing.

@DonsFormula? : Used: 1 times'End'

Error in formula name 'DonsFormula?', reserved characters '{', '}', '@', '?' cannot be used in formula name.

Also note, in older reports if you used the above reserved characters the .Check method will generate an error also.

Don

Former Member
0 Kudos

Hi Don

Thanks for the fast answer. We already know which ufl Library causes the Problem, but we need to prevent the Crystal Report Runtime loading the library, because of the hanging up at the termination of our Application (The Library isn't from us). So Kendall wrote, that he managed to ignore the Library from loading and I like to know how he did it.

0 Kudos

Hi Sandro,

You cannot prevent CR from loading a UFL except to remove all references from the report.

I'm sure using the try/catch on .Check is the how it should be handled. Just ignore the catch or log it if you have logging built in so you can see which reports are using UFL's.

Did you test it?

Don

Former Member
0 Kudos

I can't recall exactly the solution we employed, other than that we modified our registry to ignore the user library. Did not need to modify our reports.

Former Member
0 Kudos

Ok, thanks for the answer, I'm gonna try this.

Former Member
0 Kudos

We included a log output in our try/catches, but there was no error. Deregister or registrykey hiding is not an option, because the forgein applications which uses the CRUFL Library have to run on the same system, at the same time. We need a proper Solution for this problem.

former_member183750
Active Contributor
0 Kudos

Hi Sandro

There really is no way to tell the CR engine to ignore or not load a specific DLL. Not sure if there are ways of telling an app exe to ignore dlls in general - if there are, MS would be the place to look.

However, let me take another tack to this problem:

Presumably, the "foreign" application is able to use the DLL without problems(?). That being the case, doing a bit of investigating as to why that app has no issue and yours does may prove to be fruitful. I'd start with determining the version of the CR rutime the foreign app is using. Modules may prove top be a useful utility here - if this is a 32 bit app.

A question that has not been asked - I think: Do you have an issue with the same UFL (Crystal Translator has a CRUFLCT2.dll) as Kendall? If not, what is the suspect UFL? How do you know?

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Hi Ludek

Ok, here's the situation:

1. Our Application, implemented in C++ (32 Bit), Crystal Reports Version 13 (32 Bit), no use of an UFL Library.

2. Foreign Application, implemented in VB6 (32 Bit), Crystal Reports 11 Com (32 Bit), implemented and use a custom Com Library called CRUFLDgcFunction.dll.

We used the Crystal Version 11 and both Application worked like a charm side by side. No we switched to the Version 13. For this, we implemented a CSharp Wrapper class with the Crystal Viewer Control and included this in our Application over ComInterop. This worked and the Reports too, but if the CRUFLDgcFunction.dll is registered on the system, the Crystal View freezes about 4 minutes when it's getting closed.

Side Note: We tested an empty com Library (no code!) with the same name (CRUFLDgcFunction.dll) and the problem persisted.

Please let me know, if you need any further informations.

Former Member
0 Kudos

Hi

The Issue still persist, the report can't be closed:

After the CReportDocument.Close() Function the application doesn't response anymore. We need a Fix here, because we need to deliver the Application at our Customers!

Former Member
0 Kudos

Hi,

We also face the same issue.

Are you managed to solve it? Can share with the solution?

Thanks

Answers (0)