on 02-12-2014 9:28 PM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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
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.
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
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
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.
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.