cancel
Showing results for 
Search instead for 
Did you mean: 

.NET program using Crystal Reports ActiveX Designer Run Time Library 10.0 (through COM INTEROP) crashes on Export() if report has user defined function

Former Member
0 Kudos

Our company has a legacy application (VB6) that uses Crystal Report Designer Runtime Library 10 to display/export reports created using Crystal Report 10.  That has been working fine for years.

Recently we are developing a web application which uses ASP.NET MVC to show those same reports. Both applications have to co-exist so we prefer as little changes to the reports or crystal report runtime library as possible. So we generated the Interop.craxdrt.dll through referencing the craxdrt.dll from Visual Studio and use it to manipulate the reports. The back end Service exports the report as pdf file and the client display the pdf file on the web page. It works fine if the report does NOT have any User Defined Functions. For those reports that have VB UFL fields, the WCF service crashes on report.Export(). I made a test program in Visual Studio 2008 that uses interop.craxdrt.dll to simply export the report as pdf and it also CRASHES on report.Export() for reports using VB UFL.

So my question is how to solve this with minimum change?  Thank you in advance.

-Susan

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Hi Susan

Can you please define "crashes"? Error? Behavior? Etc.

What version of CR? Please be precise. E.g.; CR 12 is not precise (best place to look may be in the CR designer Help -> About.

See if a simple test .NET app that does not use interop and the UFL works. Could be as simple as;

CrystalReportsViewer1.ReportSource = "path to report"

Finally, note that CR 10 has been out of support for close to 10 years and upgrade to current version of CR and full CR SDK for .NET may be required.

BTW.; CR 10 did not support any of the current Operating Systems either. So WIN 7, WIN 2008, WIN 2012 would most certainly cause issues.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

Hi Ludek,

"Crashes" as in "AppCrash", "Kills the program", no error, it just goes away. And looking at the windows logs, it is faulting in Kernelbase.dll.

CR version is 10.0.0.533. "CR 10 has been out of support for close to 10 years" - I have been suspecting something like that. But our VB6 app that uses it has been working for the most part on windows 7 and win 2008 (the majority of our customers' set up) and it is not going to go away for a while.  I was hoping there's some workaround for our pilot web app in the short run and we will look into upgrading in the long run.

>See if a simple test .NET app that does not use interop and the UFL works


I don't quite understand. I thought CR 10 runtime is COM and for .NET to use it, there has to be interop of some sort...?

My questions:

1. What's the current version of CR and sdk for .NET? and what's the cost of upgrading?

2. Does the current version of CR support VB6? If not, upgrading is probably not going to be our choice. In that case, even if we upgrade for ,Net program, we will have to keep distributing CR runtime for both versions to support VB6. Can they co-exist?

Thank you very much

-Susan

former_member183750
Active Contributor
0 Kudos

Hi Susan

Great questions so let's cover them off one by one. Oh, before we do a note on a couple of things:

First:


CR version is 10.0.0.533. "CR 10 has been out of support for close to 10 years" - I have been suspecting something like that. But our VB6 app that uses it has been working for the most part on windows 7 and win 2008 (the majority of our customers' set up) and it is not going to go away for a while.  I was hoping there's some workaround for our pilot web app in the short run and we will look into upgrading in the long run.

Using any product on an unsupported OS, is risky. In the case of CR, I've seen apps work, then not and no reason for that. I've seen apps not work - period. I've seen apps work with no issues. Those are the risks. Add to it interop and we're in a sort of a la la land...

Reason I wanted a simple .NET app (no interop) was to see if the UFL would even load there. All you need to do is add a viewer to a form and on page load add one line of code: CrystalReportsViewer1.ReportSource = "path to report". You can use a saved data report, or not. If the report does not have saved data, it will prompt for a db logon. VS .NET Sample apps are here:

Crystal Reports for .NET SDK Samples - Business Intelligence (BusinessObjects) - SCN Wiki

I'd recommend vbnet_win_simplepreviewreport to start with.

OK. The questions:


What's the current version of CR and sdk for .NET?

Since you are using VS 2008, you'd have to obtain CR 2008 (v. 12.x).


what's the cost of upgrading?

I really do not know (on purpose) as this is a question for sales: 866-681-3435

Worldwide Office Locations | SAP

There is a later version of CR; SAP Crystal Reports, developer version for Microsoft Visual Studio (V. 13.x). This version is free, however it is only supported in VS 2010 and 2012 (2013 end of March). Note that SAP Crystal Reports 2011 (v. 14.0.x) and Sap Crystal Reports 2013 (v. 14.1.x) do not include and SDKs. For more info see this blog.


Does the current version of CR support VB6?

No. Not even MS supports VB 6 anymore(?). The last versi of CR to support VB 6 was CI R2 (v. 11.5). This version is also out of support - has been for 2+ years. I am not sure if it is still available - perhaps something to ask sales(?). CR XI R2 did support WIN 7 (not sure about WIN 2008).


we will have to keep distributing CR runtime for both versions to support VB6. Can they co-exist?

Yes. All versions of CR, from 9 up are side by side compatible.

Lots of info here I know. But if you need more clarity, please do ask

- Ludek

Former Member
0 Kudos

Hi Ludek,

Thank you very much for prompt reply. That IS a lot of information! I feel like a dinosaur  and we are I didn't even know VS2008 comes with CR SDK for .Net but your blog (this blog) helps.

First of all, I ran such a simple .NET test program. Same thing,  it failed to show reports (created in CR 10.0.0.533) with VB UFL, however, it didn't crash, it did give an error message:

---------------------------

Crystal Report Windows Forms Viewer

---------------------------

The Visual Basic UFL that implements this function is missing (or U2lcom.dll is missing).

Error in File C:\Users\susanl\AppData\Local\Temp\Command Sets {2C646B5D-ABFB-4416-8133-1F24ECB053AA}.rpt:

Error in formula  <Operator>.

'hecMiscOperatorName

'

The Visual Basic UFL that implements this function is missing (or U2lcom.dll is missing).

---------------------------

OK  

---------------------------

Does it mean there's no hope of reusing the close to 100 factory made reports with VB UFL in our web app without modification to the reports, no matter we upgrade Crystal Report or not? 

What do you think of these ideas:

1. Find a workaround for UFL and continue to use the unsupported CR 10 runtime, although I have none on top of my head. We use UFL to get the operator name and decrypt data based on some database settings.

2. Use VB6 program to export the reports as pdf and use them in web app from there.

3. Upgrade CR. However, we will still need to upgrade all those ~100 reports, right? Use .NET ufl?  BTW, we use both VS2008 and VS2010, more the latter. The SDKs for both are free, right?  Which version comes with the full CR Designer?

Sorry, I have 10 year worth of questions here. Thank you for your patience.

-Susan

0 Kudos

Hi Susan,

I can add some more info also....

Typically the issue is due to IIS not having access to the COM UFL. But usually that error message indicates the UFL is missing a dependency. Process Monitor or Dependency Walker may tell what is needed.

Also, the error can indicate IIS doesn't have access to the UFL, regsvr32 the UFL under the same account as IIS is running under, usually the PC admin account works.

Also, what you are doing is absolutely not supported. There are known limitations of using the COM-Interopt to pass objects between .NET and craxdrt embedded in a dll. Like Ludek said, others have tried, sometimes it works and sometimes it just stops working. The problem is too many COM layers to go back and forth between to be stable, never was supported and never will be.

So even though you want to continue running your legacy app be aware it can have other problems.

In CR 2008 and VS 2008 and above we've create a new UFL interface that fully supports UNICODE, CR 9,10, XI and XI R2 had limitations with string conversion, VB handled it though. So we created a new COM bridge dll in CR 2008 and above.

Search for this kbase article:

1603381 - How to create a C++ UFL using the new Unicode UFL interface in Crystal Reports 2008 & late...

It has a sample VS 2008 UFL in C++ but there is a link in there to get you to a VB COM UFL that you can use to update your UFL to use the new bridge dll, u212manager.dll, you'll see it in CR Designer as UF12Manager.dll

Instructions on how to GAC the UFL also are included in the KBA.

So first, use Processmonitor or Dependency Walker to see what MS dll's your current UFL is looking for if any. Typically the VS 2005 C++ Redist package from Microsoft is my first guess.

Second, have a look at the new UFL samples and update your UFL to use in your new ASP.NET App

Third, try to get your users off of the legacy app as soon as you can. Since Windows XP is ending life in a few months this is even more important to do.

Forth, I don't recommend side by side installs in your case, normally I do, but because you are using COM-Interopt it may cause both applications to have problems.

Finally see this link on the licensing for .NET applications:

Don

former_member183750
Active Contributor
0 Kudos

Hi Susan

Your questions are excellent and I do understand the pressures for trying to keep older things running as long as possible. Don has some excellent points, though his comment on the "new UFL interface" would more than likely only come into play if you go .NET all the way. E.g.; the ufl you are using now "should" work. And this is where I want to drill into things a bit more. Again a Don mentioned re. the error in the test app, there is something missing and thus preventing the ufl from running. It may be a dependency and the Depends utility will tell you that. You can download it from here:

Dependency Walker (depends.exe) Home Page

As per Don, the ufl may need to be registered using regsvr32, so try that. Once teh above has been done, try to run the simple app, see if the error goes away. If it does, do the same steps for the "real" app (e.g.; register and dependencies).

To answer your questions.


Does it mean there's no hope of reusing the close to 100 factory made reports with VB UFL in our web app without modification to the reports, no matter we upgrade Crystal Report or not?

I do not think so (hope not). We have to find out what it takes to run the report successfully in the simple app. Once we get over that hump, I suspect we'll be 90% of the way to getting the "real" app working. (Keeping in mind all the unsupported stuff and all that... sorry, had to bring that up again )


1. Find a workaround for UFL and continue to use the unsupported CR 10 runtime, although I have none on top of my head. We use UFL to get the operator name and decrypt data based on some database settings.

Eeeck... I can't think of any work-arounds. And even if there were, altering 100s of reports just sounds creepy...


2. Use VB6 program to export the reports as pdf and use them in web app from there.

That may not be a bad idea, thought you will loose any ability to drill down. You could stream the report to the web browser (just search for 'crystal stream net') and you'll get good KBAs on that. Now, we'll still be on that CR 10 not supported on modern Operating Systems high horse...(sorry, I'm so bad.)


3. Upgrade CR. However, we will still need to upgrade all those ~100 reports, right? Use .NET ufl?  BTW, we use both VS2008 and VS2010, more the latter. The SDKs for both are free, right?  Which version comes with the full CR Designer?

Ahh - probably the best question(s) of them all. You do not need to upgrade any of the reports, unless they are created in CR 8.5 and lower (and even then, if you keep your fingers crossed, this may be ok for 90% of the reports). As Don mentioned a .NET ufl is a way to go, though I am not so sure we need to do that. E.g.; I think your current ufl should work. As to the best version to work with. This is where things get a bit confusing. SAP Crystal Reports 2013 is the most current stand-alone version of Crystal Reports. However this version does not install any SDK. The equivalent SDK is from SAP "Crystal Reports, developer version for Microsoft Visual Studio" (CRVS), which is free and can be downloaded from here: . This version has a designer, but it gets incorporated into the VS IDE. Also this version of CR is only good for developing with VS 2010 and 2012. For development in VS 2008, you want Crystal Reports 2008. This is a stand-alone version and installs the SDK. The version of CR that bundled with VS 2008 is not as fully featured as CR 2008 and the designer, like in CRVS, is part of the VS IDE (E.g.; not stand-alone exe). I wrote the following blog trying to explain the differences:

And that is about it. Hope most of your questions are answered. I'l leave the rest up to Don as I'm heading to Maui for the next two weeks...

Happy coding,

- Ludek

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you Ludek and Don, I will digest your answers one by one... (and maybe come back with more questions )

Wish you a good trip, Ludek, lucky you!

-Susan