cancel
Showing results for 
Search instead for 
Did you mean: 

UFL deployment issue

Former Member
0 Kudos

I have created a new UFL (my first) using VS2013, following the many docs in this forum.

My UFL builds cleanly, and gacutil and regasm give the appropriate output.

When I start CR2013, no new items show in Additional Functions.  I viewed crw32.exe with DebugView++ and see a message at startup.

Edit:

Aggravating.  Do not know if it is IE or the SAP forum, cannot paste into message.

The message I get is:

Failed to fetch function information for COM UFL: CRUFL SciNotation.SciNotationUFL

since the message spcecifically mentions COM UFL, I think this is emitted by CR?

Edit 2:

Some more facts.

I did the regasm in an elevated prompt, using the 32 bit version.

The various docs have us copying the dll to all kinds of locations.

Man, what is the deal with pasting here.  I settled on a path I will add later when I determine what is up with copy and paste.

Edit 3:

I retargeted the assembly from .net 4.5 to .net 3.0.  Rebuilt, and remove the old from the gac and used gacutil to reinstall.  Used gacutil /l to verify which version was installed.   No change.

Edit 4:

I think the problem is I have no u2lcom.dll (nor u212lcom.dll).  I have SAP Crystal Reports 2013 Support Pack 3

Product Type Full.

Should I have that dll?

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member183750
Active Contributor
0 Kudos

Hi Steve

Not knowing what dosc you followed, it's hard to offer much help, other than docs I think may be of use - which you've probably seen already... So try this KBA:

1266912 - How to deploy Crystal Reports UFL created in Visual Studio .NET

Note that you will have to adjust the path as per Brian's post.

Oh, re. pasting... not sure. Works fine for me - IE or Firefox.

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow us on Twitter

Former Member
0 Kudos

I did follow those instructions.  I also corroborated them with the Developer guide for CR2012 from some of your prior links.

I used AnyCPU as the target arch and the folder where my UFL is is the same folder the U212COM.DLL is.  Interestingly, I do not have a listing in the formula editor for ".Net and COM" like I have seem people mention.

Edit 1:

I do not see a way to set 32 bit for certain.  I see an item called "Prefer 32 bit", but it is ghosted out.

I think by choosing AnyCPU, it puts the assemblies out as MSIL and is supposed to work in both.

former_member183750
Active Contributor
0 Kudos

The problem with any cpu is that when you deploy it to a 64 bit OS, the OS by default demands that this be a 64 bit dll and thus will only support 64 bit "runtime". Now, CR designer, being a 32 bit app (e.g.; using 32 bit "runtime"), will not load this UFL.

You must compile the dll as 32 bit in order to deploy it to a 64 bit OS and get it to work with the CR designer. I do not know why the project will not compile as 32 bit. Perhaps a question for MS forums?

- Ludek

former_member292966
Active Contributor
0 Kudos

Hi Steve,

In Visual Studio open your project Properties, not the Solution Properties.  Nagivate to Build and you should see Platform target.  If that is set to Any CPU you should be able to set it to x86.  If you are adventurous, you can also put a check in Prefer 32 bit.

This should compile it to 32 bit.

Good luck,

Brian

Former Member
0 Kudos

Well, at least I found MKT-256 and see I am not crazy regarding my inability to paste into the SAP forum.  Seems others are having issue with IE11.

My research into "Prefer 32-bit" seems it applies to exe's, not class assemblies.

I've cleaned my environment, removing the earlier compilations from the gac using gacutil.  I've been incrementing the assembly version so I know I am looking at my most recent build.

It does not help to target .net 4.51 or .net 4.0.

Thanks Brian and Ludek for your input!

Former Member
0 Kudos

Still no joy on this.

former_member183750
Active Contributor
0 Kudos

Hi Steve

Please confirm that the following is true:

1) The UFL is compiled as 32 bit

2) You GAC-ed the UFL and on completion you received the message "Assembly successfully added to the cache."

3) Yo used REGASM on the DLL

If all of the above is true, can you attach the ufl?

- Ludek

Former Member
0 Kudos

The only part I am not 100% sure of is the 32bit compilation.

I do not have a 32 bit development machine, so I am trying to determine how to target 32 bit.

I have already chosen x86 as the target.  The "Prefer 32 bit" option referred to in prior emails I understand applies to executables, not assemblies.

Would it be possible for one of you SAP insiders to try a "Hello World" UFL and verify base functionality works with CR2013?

former_member183750
Active Contributor
0 Kudos

Last time I checked this worked fine. The KBA 1525014 - Sample C# .NET UFL and Localization Formula function has a .NET UFL (CRUFLDotNetSample.zip) attached to it. Can you see if this will work for you?

- Ludek

Former Member
0 Kudos

Will do.  Thanks.

Here is a screenshot of dotPeek viewing my prior compilation.  It does confirm it is 32 bit (x86).

Former Member
0 Kudos

I was able to use that compiled UFL.  I did not try compiling it myself.

I did notice that dll was compiled with AnyCPU, not x86 so I'll probably put mine back to that.  You can see that in dotPeek that it is an MSIL assembly.

I looked at the installation bat file in your zip and noticed it used the /codebase arg on regasm.  I do not think I used that arg.  I will try that and report back.

Former Member
0 Kudos

The install.bat included did regasm, but not gac'd.  so the gac is nice but not necessary.

Trying to my install compilation of your example solution now.

Former Member
0 Kudos

My compilation of your solution worked properly.  I tried reinstalling mine using the regasm.exe /codebase arg.  No change.  At this point I am looking at the differences between the two projects.

Former Member
0 Kudos

Ludek, I noticed in the example that works, it does not set either the interface or the base class as ComVisible(true) as the prior docs state.

former_member183750
Active Contributor
0 Kudos

Yeah, but that I'd suspect may affect how the UFL works, not how it is installed and registered? I'll ask around here and get back.

- Ludek

Former Member
0 Kudos

I have traced this with Procmon and DebugView++ and have some info that you and Don may find interesting.  I see that cr32w.exe is seeing my class by the regkeys it is reading and enumerating.  I can also see an error message that I believe has to come from CR regarding my UFL that does not occur on Don's UFL.

Failed to fetch function parameter information for COM UFL

Former Member
0 Kudos

Only other major difference I saw between your example and my code is the COMInterfaceType.

My example is InterfaceIsDual and Don's is InterfaceIsDispatch.  I have not seen any documentation stating one or the other MUST be used.

0 Kudos

Hi Steve,

Ludek is correct, CR Designer is a 32 bit app so the UFL MUST be compiled in x86 mode and copied to this folder also.

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 Precessing 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

The likely issue you are having is by default CR Designer runs on 2.0 or lower framework. If you compile the UFL in 4.0 or 4.5 etc. then you have to tell CR Designer to use this framework also.

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 runtime 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.

Don

PS - I'm sure I Kbased this but can't seem to find it. I'll add it to the one noted in this post

Update the KBA's:

1266912 - How to deploy Crystal Reports UFL created in Visual Studio .NET

1525014 - Sample C# .NET UFL and Localization Formula function

Message was edited by: Don Williams

Former Member
0 Kudos

I have tried this with no change.

This change does not explain how your example project from 2008, when compiled on my machine targeting .net 4.0 msil (not x86) loads correctly.

There has to be a syntax error with what I have done but the error message doesn't lend itself to discovering what the issue is.

Edit:  your UFL was visible in CR2013 without copying it to "c:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86"

Edit2:  I need to contact someone in your sales department to get a support contract.  I see the link to purchase a single incident.  It will be next week before I can get approval to spend that kind of money.  I am also out of the office next week.

Does the error message that I quoted from DebugView++ point to the fact the class visible where it is installed, but is having issue with a parameter.  I only have one string arg to my UFL.

Edit 3: I will start from scratch with the simplest UFL I can make to see if I get different results.

Edit 4: My existing project is so simple.  I attached to my running crw32.exe in VS2013 debugger, and the output windows shows that I am linked to my class.

crw32.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'crw32.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\romanows\Downloads\CRUFLDotNetSample\CRUFLDotNetSample.dll'. Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.

'crw32.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'C:\Users\romanows\Documents\Visual Studio 2013\Projects\CRUFL_SciNotation\CRUFL_SciNotation\bin\Debug\CRUFL_SciNotation.dll'. Symbols loaded.

0 Kudos

Hi Steve,

OK back to the original issue...

Have you tested the sample?

1525014 - Sample C# .NET UFL and Localization Formula function

Can you see the functions and use them?

I confirmed this sample does work when built in VS 2013 and setting the CR Designer Config file to 4.0 Framework as noted earlier.

PS - update the data source for the test report and use the Xtreme.mdb

DOn

Former Member
0 Kudos

Yes, that ufl works on my system.  I tested 3 ways, using the precompiled dll from the zip, and a recompilation that I did targeting .net 2.0 and 4.0.

0 Kudos

So what happens if you put your function in the sample UFL?

Either replace one of the existing functions or add your function to it.

In VS 2013 project properties I set the output folder to:

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

So even though the ufl is in the GAC CR still needs access to the dll so it can load it into it's memory space.

Full 4.0 Framework, cannot use Client. And CPU is set to X86.

What OS are you developing this on?

Former Member
0 Kudos

Win7 Pro x64.  Let me try what you said with placing my function into your sample project.

Edit 1; I am assuming I will need to make new guids for my functions and prepare another signing key?  Don't think VS will let me link this otherwise.

Edit2: Do you think there is a hard requirement on the interface having InterfaceType(ComInterfaceType.InterfaceIsIDispatch)?  yours uses IDispatch, but the pattern I was following uses InterfaceIsDual.  since that seems to be specifically about parameters, seems relevant.

Edit3: I have added my functions, created new GUID's, (did not create a new snk).  No effect.

I changed my ComInterfacetype to IDispatch and tried to emulate your functions.  No effect.

I changed the assembly version string so i could verify that i have the new build, and that can be seen in the screenshot below.  The green and red hilight shows that my classes ARE in the assembly, I just have that pesky load time error mentioned earlier.

Former Member
0 Kudos

Don,

Could you try this example in your build environment.  This project was the basis for my work.

http://technet.microsoft.com/pt-br/subscriptions/ms227603(v=vs.80).aspx

0 Kudos

Hi Steve,

That would be why. In CR for VS 2005 it still used the old u2lcom.dll to bridge a COM dll to CR. This also required you to define/convert your strings to MBCS type in the UFL. CR 9 and above now uses UNICODE internally but the UFL bridge did not on that version. As of CR 2008 we now use U212COM.dll to do the bridging and it fully supports UNICODE characters so not required to define the string as MBCS.

Likely if you define the string as MBCS it will work for you. Makes sense with the error you are getting also.

PS - not going to run through MS's article on how to to test if it's the cause. If you want to attach your UFL code to this post and I have time I'll give it a try. Use the Advanced Editor, rename your zip file to *.txt and then attach.

Don

Former Member
0 Kudos

I think I mispoke.  The howto I used was from technet, and was that Currency Exchange, but it wasnt specifically the vs2005 version. 

I am not using bstr and MBCS anywhere.  Thank you for looking at this.  I am about to be away from my computer for a week.  I will get back into this late next week.

Former Member
0 Kudos

Don, Ludek,

I am going to drop this issue and just implement a formula in my report.

Maybe I will pick up UFL's (or whatever tools are brought to the table) again on the next release.

Thanks,

Steve

0 Kudos

Hi Steve,

You have to tell CR Designer what framework to start up in also to view your UFL.

If you don't have one create a file called "crw32.exe.config"

and put this in it or edit the one you do have:

<?xml version ="1.0"?>

<configuration>

  <startup useLegacyV2RuntimeActivationPolicy="true" >

    <supportedRuntime version="v4.0" />

  </startup>

</configuration>

You should now see your UFL in CR Designer.

Don

Former Member
0 Kudos

Ahh, that might do it.  I’ve since just written a formula field to handle that one report.  I hoped to have a general solution I could use in other reports but I had too much time in it to continue.

0 Kudos

Ya sorry about that, I forget that part of the equation....

former_member292966
Active Contributor
0 Kudos

Hi Steve,

When you go into Crystal Reports, go to Help | About Crystal.  There is a More Info button at the bottom.  This will list all the DLLs Crystal is loading.  After you open your report and try running it, go to the More Info window and see where Crystal is loading the other UFLs from.

If you have compiled the DLL in 32 bit and registered it you should see it.  Crystal is 32 bit only so your DLL must also be 32 bit.

Good luck,

Brian