Skip to Content
0
Former Member
May 12, 2016 at 03:53 PM

Unable to see UFL methods in Additional Functions. Using CR2013/VS2012 (.net 4.5)

918 Views

We are working on creating a UFL to access a custom method in Additional Functions in CR2013 Designer. We followed the article “Creating Crystal reports User Function Libraries (UFL) with Visual Studio .NET” by Ludek Uher in SCN and deployed the DLL in GAC and registered with RegAsm as well. But we are unable to see the methods in Additional Functions. We do not see any folder for u212com.dll.

Here's what we have done in detail:

We created a .NET class library with the project name CRUFLSales with an interface class and an implementation class. Both the interface and the implementation class have COM and GUID attributes.

Interface Class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Runtime.InteropServices;

using Oracle.DataAccess.Types;

using Oracle.DataAccess.Client;

namespace CRUFLSales

{

[ComVisible(true), InterfaceType(ComInterfaceType.InterfaceIsDual), Guid("4D06968D-043F-447E-9AFB-8C3BD767A366")]

public interface IAudit

{

//Audit Class methods Signatures

long Method_1(string param1);

}

}

Implementation Class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Runtime.InteropServices;

using Oracle.DataAccess.Client;

using Oracle.DataAccess.Types;

using System.Windows.Forms;

using System.Data;

namespace CRUFLSales

{

[ComVisible(true), ClassInterface(ClassInterfaceType.None), Guid("F448164C-6223-4067-BC53-7E9F4FB9DE13")]

public class Audit : IAudit

{

public Method_1(string param1)

{

//Method code here..…

}

}

}

We also checked the option “Register for COM Interop” in Build Tab and checked the option “Make COM Visible” in Assembly Information tab. Build Platform is x86 (32-bit). Used a Strong key name in the Signing tab and generated DLL.

After generating the DLL, we followed the below steps to register the DLL.

Copied the DLL to C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86 and using Visual Studio Command Prompt – ran gacutil -i <<dll name>>

Copied the DLL to C:\Windows\Microsoft.NET\Framework\v4.0.30319 and ran RegAsm.exe < > to register as 32 bit UFL.

I could see the DLL is registered at C:\Windows\Microsoft.NET\assembly\GAC_32 .

After that, when I went into CR designer, opened a report and went into Formula editor screen – I don’t see the methods of my UFL inside Additional Functions. I do not see any folder for u212com.dll at all.

Opened Visual Studio 2012, Visual Studio Command Prompt and CR2013 with administrator privileges.

Software Versions

MS Visual Studio 2012 (.net framework 4.5)

DLL generated and deployed in Windows 7 (64 bit OS).

Crystal Reports 2013

Can someone let us know where we might have gone wrong? Thanks in Advance for your help!