cancel
Showing results for 
Search instead for 
Did you mean: 

.Net UFL in 64bit application shows UFL u212com.dll that implements function is missing.

0 Kudos

Setup:

  • Windows 10
  • Crystal Report for Visual Studio 13.0.32 64bit
  • UFL dll(targeting .Net 4.6.1, C#, compiled as Any CPU, this is part of the same solution as the test application mentioned below).
  • .rpt file that uses the .net UFL function.

Repro Steps:

  1. Compile test application(also written in C#) and the UFL dll as AnyCPU or 64bit. The application is a very simple windows forms application. Using a ReportDocument instance, load the rpt file and assign the instance to the crystalReportViewer instance.
  2. Copy the ufl dll to C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64
  3. Register the UFL dll via regasm
  4. Run the test application and receive this error

Additional Information

  • If the application is compiled as 32bit with the same steps above(except copied into the win32_x86 directory instead of win64_x64), then the test succeeds without error.
  • In crw64.exe(version 2020, file version:14.3.2.4304), the UFL does not appear in the formula editor when editing the report even after putting the UFL in the C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64 directory and registering it via regasm. This node, COM and .NET UFLs(u212com.dll), does not appear anywhere in the treeview of functions:

  • However, crw32.exe(prior to version 2020) of the same dll compiled with AnyCPU and placed in C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86 appear without an issue in the formula editor.
  • The UFL uses only the default references added by visual studio:
  • Using procmon, I can see that the registry is searched and that the class is found for the UFL, but the 64bit test case fails to even look in the file system for the UFL dll.

Please let me know if anything is unclear or I can provide any additional information?

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Set the project to X64, CR runtime is for your project platform and the OS.

Search for this KBA - 1525014 - Sample C# .NET UFL and Localization Formula function

Resolution

  • To use this UFL you need to register it with VS .NET
  • Use the regasm command line tool (C:\Windows\Microsoft.NET\Framework\v2.0.50727\RegAsm.exe or C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe)
  • This UFL only works with Crystal Reports 2008 Service Pack 1 and higher
  • For more details see the readme.txt file included in the attached zip file

Also Note:

To change the Class Name so the function name (DotNetSampleClass) is not listed in Crystal Report Designer do the following:

  1. Click on the View menu in .NET IDE and select Show Class View.
  2. Then right click on the class and select Rename.
  3. The delete all but "CRUFL"
  4. Click the OK button and yes to the next prompt to confirm the name change.
  5. Do the same for the "Class Test" and change it to something like "Fnt".

Now you will see the function named: Fnt StringLength.

To be able to use the UFL in CR Designer you need to tell the Designer to use the same framework by doing the folowing:

To see this new UFL in Crystal report Designer do the following:

  • Crystal Report Designer 2011/2013 is a 32 bit app so the UFL MUST be compiled in x86 mode. If you plan to use the UFL in a 64 bit application then you need a separate 64 bit version:
  • Copy the file and for CR 2008 place it in this folder:
  • C:\Program Files (x86)\Business Objects\BusinessObjects Enterprise 12.0\win32_x86
  • For CR 2011/2013 in this folder:
  • C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86
  • CR for VS is the only 64 bit runtime we have except for BI 4.x also may require it. Depending on the CR Processing Server it may need the 64 bit UFL and 32 bit UFL.

For 32 bit App:

  • C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win32_x86
  • C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86

64 bit App:

  • C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports for .NET Framework 4.0\Common\SAP BusinessObjects Enterprise XI 4.0\win64_x64
  • C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x64

To be able to set Crystal Report Designer to use the same Framework you created the UFL in you must tell CR Designer whcih one to use by doing the following:

Create a file called:

crw32.exe.config

And paste this into it:

<?xml version ="1.0"?>

<configuration>

<startup useLegacyV2RuntimeActivationPolicy="true" >

<supportedRuntime version="v4.0" />

</startup>

</configuration>

Change the "supportedRuntime version" to what ever framework you are compiling your UFL in.

Save this file into the same location as crw32.exe:

For CR 2011/2013:

C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86

And for CR 2008:

C:\Program Files (x86)\Business Objects\BusinessObjects Enterprise 12.0\win32_x86

Now you should see your functions in the list in CR Designer.

For CR 2020 you need a 64 bit version of the UFL:

Create a file called:

crw64.exe.config

And paste this into it:

<?xml version ="1.0"?>

<configuration>

<supportedRuntime version="v4.0" />

</startup>

</configuration>

Change the "supportedRuntime version" to what ever framework you are compiling your UFL in.

Save this file into the same location as crw64.exe:

For CR 2020:

C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64

0 Kudos

Hello Don,

The issue on my end was that I was running regasm.exe from this 32bit framework location:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe

rather than from the 64bit framework:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe 

Thank you for the quick reply!

Jason

Answers (0)