cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Report Designer 2011 - Custom Java UFL not visible

Former Member
0 Kudos

Hello,

I'm using Crystal Report Designer 2011 and tried to load a custom java UFL, but the UFL is not visible.

I also did not see the entry "Java UFLs (u211java.dll)" under Additional Functions.

Within Crystal Report for Eclipse it works.

I found some documents and discussion but nothing seems to help.

<http://scn.sap.com/message/6637161#6637161>

<http://scn.sap.com/thread/1135925>

Our java UFL is located in: C:\Users\htr\Documents\ufls\DateTime.jar

All classes are located in the default package (root dir).

I defined the system variable CLASSPATH:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-collections-3.1.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-configuration-1.2.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-lang-2.1.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-logging.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\u211java.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\CrystalFormulas.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\CrystalReportingCommon.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\log4j.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\icu4j.jar;C:\Users\htr\Documents\ufls\DateTime.jar

I defined the system variable JAVA_HOME:

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

I extended the system variable PATH by:

%JAVA_HOME%\bin;%CLASSPATH%

In the registry I added the key:

HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\JREPath = C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\jdk\jre\bin\client\jvm.dll

In the file "C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\CRConfig.xml":

I added the UFL class to the <CrystalReportEngine-configuration> section:

     <ExternalFunctionLibraryClassNames>

       <classname>DateTime</classname>

     </ExternalFunctionLibraryClassNames>

Within the <Classpath> definition I added the variable ${CLASSPATH} and also each file defined in the system variable.

<Classpath>C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-collections-3.1.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-configuration-1.2.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-lang-2.1.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-logging.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\u211java.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\CrystalFormulas.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\CrystalReportingCommon.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\log4j.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\icu4j.jar;C:\Users\htr\Documents\ufls\DateTime.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external\jdbc\mysql-connector-java-5.1.18-bin.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\crlovmanifest.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CRLOVExternal.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CRDBJDBCServer.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CRDBXMLServer.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CRDBJavaBeansServer.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external\log4j.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CRDBSForceServer.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external\CRDBSForceExternal.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CRDBWicServer.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external\CRDBWicExternal.jar;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external\CRDBXMLExternal.jar;${CLASSPATH}</Classpath>

The file "u211java.dll" is located in "C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86".

Within Crystal Report I activated "Only Java-UFLs"

Restartet the machine - and nothing visible.

Within Crystal Report for Eclipse it works, but this is not a workaround for us.

Please can someone help me. This is a very important feature for us!!!

Best regards,

Heiko Tropartz


Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Hello Heiko,

you made a lot of work and read all the documents, to get your Java UFL running. But there must be one little thing, that is missing or wrong. Try my cookbook for Crystal XI-2 SP2-6. Please replace 3.5 with 4.0 in the following lines for your installation of CR 2011. All other steps should be the same :

1. Copy the following files from "C:\Programme\Business Objects\Common\3.5\java" to another directory called "C:\CrystalJava".

CrystalFormulas.jar

CrystalReportingCommon.jar

u211java.jar

\external\log4j.jar

\external\icu4j.jar

(place the \external files in an subfolder C:\CrystalJava\external).

The reason for this is, to get rid of the blank in the original pathname. I had issues with this, so I always use names without special chars. This might not be necessary, but give it a try.

2. Copy "MyLibrary.jar" (your UFL library) to "C:\CrystalJava".

3. Leave the <Classpath> entry in CRConfig.xml as it was before. Don't add something there. It's useless.

4. Add the following to your Classpath System Variables: "C:\CrystalJava\CrystalFormulas.jar; C:\CrystalJava\CrystalReportingCommon.jar; C:\CrystalJava\u211java.jar; C:\CrystalJava\external\log4j.jar; C:\CrystalJava\external\icu4j.jar; C:\CrystalJava\MyLibrary.jar" (where MYLibrary.jar contains your individual UFL).

Open a command promt and type "set" to see if everything shows up in the javaclasspath variable and check for missing Semicolons (or commas on non-eu-systems).

5. In CRconfig.xml make sure, that you only list the library in <ExternalFunctionLibraryClassName>, that you are really testing. Nothing else, because any wrong entry (and sometimes even empty entries) will stop all the other UFLs from working!

<ExternalFunctionLibraryClassNames>

<classname>MyLibrary</classname>

<classname>WrongLibrary</classname>

</ExternalFunctionLibraryClassNames>

In this example both "MyLibrary" and "WrongLibrary" will not show up in Crystal Reports. So only

<ExternalFunctionLibraryClassNames>

<classname>MyLibrary</classname>

</ExternalFunctionLibraryClassNames>

is correct in this case.

6. Check if your CRConfig.xml is valid (drop it in a browser and see if it is o.k.). I have searched hours for an UFL that didn't came up and in the end, it was a missing "<" in an xml-tag.

7. And from my point of view, very important: check, that all entries, pointing to the Java SDK are directing to the same(!) SDK. Following lines assume you are working with JDK 1.5.0_14

- Set the JREPath in the registry HKLM\Software\Business Objects\...\JREPath to the SDK(!)-Path "C:\Programme\Java\jdk1.5.0_14\jre\bin\client\jvm.dll"

- Set JAVA_HOME to the SDK(!) "C:\Programme\Java\jdk1.5.0_14"

- And to stay consistent, overwrite the <JavaDir>-entry in CRConfig.xml and set it to "<JavaDir>C:\Programme\Java\jdk1.5.0_14\bin</JavaDir>".

8. When you compile the UFL please make sure, that you compile with the same (or lower) Java version, that you have defined in JREPath. If you compile with eclipse most versions default to Java 1.6, but these UFLs won't work in an 1.5 environment. Better compile with "ant" on the machine you are working or check the correct Java-version in eclipse.

I have attached the MyLibrary.jar (taken from Don Williams) and compiled it with jdk1.5.0_14, so you can try it out. Just rename the .txt-file to .jar and put in in your C:\CrystalJava directory.

Hope you get it running and

kind regards

Martin Zwernemannn

Former Member
0 Kudos

Hello Martin,

thank you very much for your help.

It's hard and unbelievable to say, but did not work.

I have installed JDK1.5 (32Bit) and JDK1.6 (32Bit) and tested both Java Development Kits.

I created a directory "C:\CrystalJava" and tested your recompiled UFL "MyLibrary.jar" from Don Williams.

From "C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib" I copied the files "CrystalFormulas.jar; CrystalReportingCommon.jar; u211java.jar; MyLibrary.jar" into "C:\CrystalJava".

From "C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\externa\" I copied the files "icu4j.jar; log4j.jar" into "C:\CrystalJava\external".

I set the environment variable "CLASSPATH" to "C:\CrystalJava\CrystalFormulas.jar;C:\CrystalJava\CrystalReportingCommon.jar;C:\CrystalJava\u211java.jar;C:\CrystalJava\myLibrary.jar;C:\CrystalJava\external\icu4j.jar;C:\CrystalJava\external\log4j.jar"

I set the environment variable "JAVA_HOME" to "C:\Program Files (x86)\Java\jdk1.6.0_37" and tested also "C:\Program Files (x86)\Java\jdk1.5.0_11".

I added "%JAVA_HOME%\bin" to the front of the "Path" environment variable.

I set the registry key "JREPath" in "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\JREPath" to "C:\Program Files (x86)\Java\jdk1.6.0_37\jre\bin\client\jvm.dll" and tested also "C:\Program Files (x86)\Java\jdk1.5.0_11\jre\bin\client\jvm.dll".

0 Kudos

Hello Heiko,

did you remove all the other lines from the classpath system variable, that you entered before? I mean things like C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\commons-collections-3.1.jar from your original post.

Did you check points 3, 5 and 6 from my "cookbook" concerning CRConfig.xml?

Kind regards

Martin

Former Member
0 Kudos

Hello Martin,

thank you very much for your help.

It's hard and unbelievable to say, but did not work.

I have installed JDK1.5 (32Bit) and JDK1.6 (32Bit) and tested both Java Development Kits.

I created a directory "C:\CrystalJava" and tested your recompiled UFL "MyLibrary.jar" from Don Williams.

From "C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib" I copied the files "CrystalFormulas.jar; CrystalReportingCommon.jar; u211java.jar; MyLibrary.jar" into "C:\CrystalJava".

From "C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\externa\" I copied the files "icu4j.jar; log4j.jar" into "C:\CrystalJava\external".

I set the environment variable "CLASSPATH" to "C:\CrystalJava\CrystalFormulas.jar;C:\CrystalJava\CrystalReportingCommon.jar;C:\CrystalJava\u211java.jar;C:\CrystalJava\myLibrary.jar;C:\CrystalJava\external\icu4j.jar;C:\CrystalJava\external\log4j.jar"

I set the environment variable "JAVA_HOME" to "C:\Program Files (x86)\Java\jdk1.6.0_37" and tested also "C:\Program Files (x86)\Java\jdk1.5.0_11".

I added "%JAVA_HOME%\bin" to the front of the "Path" environment variable.

I set the registry key "JREPath" in "HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports" to "C:\Program Files (x86)\Java\jdk1.6.0_37\jre\bin\client\jvm.dll" and tested also "C:\Program Files (x86)\Java\jdk1.5.0_11\jre\bin\client\jvm.dll".

Restarted my machine, opened a console and checked the environment variables with "set". Everything was OK.

Within the configuration file "CRConfig.xml" I changed the <JavaDir> and <JavaDir32> element to "C:\Program Files (x86)\Java\jdk1.6.0_37\bin" and tested also "C:\Program Files (x86)\Java\jdk1.5.0_11\bin".

Removed my own <Classpath> settings -> reset to default settings.

Adapted the <ExternalFunctionLibraryClassNames> configuration the class "MyLibrary".

I attached my "CRConfig.xml" file without the <keycode> section.

Can you check the configuation file again, please.

After all I restarted my machine again. I started Crystal Report Designer, created an Report and opened the formula editor.

Scrolled down to "Zusätzliche Funktionen", but it is always empty.

Last week we completely switched to "Crystal Report for Eclipse" and our Java UFL's are working great. We also stopped using "Crystal Report Server" and now we developing an own "Crystal Report Engine/Server" based on Java.

We suggest our customers not to buy "Crystal Report Designer", instead they should use "Crystal Report for Eclipse". It is not so nice and intuitive but it works out of the box.

Thanks for your help. More tips are welcome.

Best regards,

Heiko Tropartz

(Siemens Enterprise Network)

Former Member
0 Kudos

Sorry, my last answer was incomplete.

Yes I have set the base configuration.

0 Kudos

Hello Heiko,

please start Crystal and select Help/Info/Further info. Are there any entries where the SDK shows up (see my screenshot)?

Kind regards

Martin Zwernemann

Former Member
0 Kudos

Hello Martin,

very interesting both DLL are not visible.

I tried JDK1.5 and JDK 1.6.

Is it possible that SAP sold us a version where Java UFL are not supported?

We pointed out that we need such a feature and they guarantee it.

See attached screenshot "cr.jpg".

Best regards,

Heiko Tropartz

0 Kudos

Hello Heiko,

I think this issue has todo something with your registry entry for JREPath.

When you are working with Windows7 in an 64bit environment the HKLM/Software node is mapped to \HKLM\SOFTWARE\Wow6432Node\BusinessObjects\Suite11.5\Crystal Reports for 32-bit apps.

Please check if you find a BusinessObjects node under Wow6432 and reenter your JREPath there.

See http://www.windowsitpro.com/article/internals-and-architecture/what-s-the-wow6432node-under-the-hkey... for more information about Wow6432Node.

As long as you don't see the JDK-Dlls in "Help/Info/Further" the entry in the registry isn't correct.

Kind regards

Martin Zwernemann.

BTW: I work a lot with Crystal Reports for Eclipse in Java development. But it's not good for customers and report designers. A lot of functionality is missing or very difficult to reach. So stay on the track, to get it running with CR-Designer 😉

Former Member
0 Kudos

Woh - one step forward. I see the DLL:

"VERIFY.DLL     5.0.110.3"

"ZIP.DLL            5.0.110.3"

But no Custom Java UFL.

0 Kudos

Hello Heiko,

the DLLS show up, so the registry path is correct. You are one step forward, to get it working. The JavaUFL itself will not show up in "Help/Info/Further". That is o.k. It will only appear, when you enter a new formula field.

If it still doesn't work, there might be something with your Java SDK. First of all don't use a 64bit-Java SDK. It won't work, because Crystal is 32-bit (even on Win7/64bit systems). Second: It is best to work with Java SDK 1.5. So I would recommend that you download and install Java SDK 1.5 32bit (my preferred version is still jdk1.5.0_14). Give it a try and don't forget to modify your Java_HOME and the JREPath afterwards. And please make the tests with the myLibrary.jar, that I sent you before.

I know, that with Crystal for Eclipse the JDK1.6 works very good. But Crystal Designer is a complete different environement.

Kind regards

Martin Zwernemann

Former Member
0 Kudos

Hello Martin,

the Java UFL "MyLibrary" is still not visible under "Custom Functions".

I tested it with JDK 1.5 (32bit), JDK 1.6 (32bit) and even the Crystal Report internal JDK 1.6 (32bit).

I checked the configuration (Registry, Environment Variables and CRConfig) twice.

In Crystal Report I reset the "Formula Editor" option to "no UFLs". After restart I set it to "only Java-UFLs" and restarted again.

Due to the fact that I changed the "JAVA_HOME" environment variable to JDK 1.5 (32bit), I could not use my machine for the daily work anymore. I have installed a lot of java tools for JDK 1.6 (64bit).

Changing and testing all these configuration files takes too much time. So I will install a VM for Crystal Report only. What a ...

More tips and hints are welcome.

Best regards,

Heiko Tropartz

Former Member
0 Kudos

Hi Heiko,

We are facing same problem as you faced.

We created one java ufl but still not visible in crystal reports addtional functions.

Have you got any solution,can you please share with me

Vissu

Former Member
0 Kudos

Hello Vissu,

I have no solution for the problem.

My last step was to install a virtual machine with Windows7 (32 bit) and to repeat all suggestions but our Java-UFL is still not visible.

The only thing I figured out is that a separate JDK installation is not necessary. The Crystal-Report Designer delivers his own JDK 1.6_x86 environment.

I assume that Crystal Report is missing some JAR files, not defined in the Classpath.

Best regards,

Heiko Tropartz

Former Member
0 Kudos

Hi Heiko,

Thank you,

Actually i am trying to implement multilingual reports.For that i created this UFL.

Can you suggest any approach that how to implement multingual reports.

Vissu

Former Member
0 Kudos

We also have a UFL to translate the content into a user-defined language.

To use Java UFL we switched from Crystal Report Designer to Crystal Report for Eclipse. There our UFL works great and Linux is also supported.

If this is no option for you, create one report for each language.

If this is also no option for you, do the same like we did - stop using Crystal Report it sucks.

Former Member
0 Kudos

Hi Heiko can we implement this using database approach ?if yes can you please suggest the process.

Former Member
0 Kudos

Yes you can but this discussion is not part of the main thread.

Sorry.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

I had the same problems. I have to use the Java 6 version located under <CR2011_HOME>SAP BusinessObjects Enterprise XI 4.0\win32_x86\jre for my JREPath registry key. It seems that Java 7 does not work. After that, I had the VERIFY and ZIP modules correctly loaded but still the problem.

I remark that log4j.jar is no more located under external folder like CR 2008. I've found a version under <CR2011_HOME>\SAP BusinessObjects Enterprise XI 4.0\java\lib directory.

After updating my CLASSPATH value (you need commons-collections-3.1.jar, commons-configuration-1.2.jar, commons-lang-2.1.jar, commons-logging.jar, icu4j.jar, CrystalFormulas.jar, CrystalReportingCommon.jar, u211java.jar, log4j and your library jar), it works for me.

I hope it can help

Cédric

Former Member
0 Kudos

Hi again,

On Seven 64 bits, you have to add the JREPath registry entry at \HKLM\SOFTWARE\Wow6432Node\SAP BusinessObjects\Suite XI 4.0\Crystal Reports instead of \HKLM\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports in order UFL works.

Regards,

Cédric

Former Member
0 Kudos

How to find / activate logging in Crystal Report?

0 Kudos

Hi Heiko,

There is no logging for the designer itself. You can look in Help, About... and the more info button to see what dll's are loaded and that's about it.

Try ProcessMonitor from Microsoft, ggogle it and you'll find the link. The look for the jars to see if they are being loaded.

I have a break between cases right now so if you want you can attach your UFL and dependencies required to run it and I'll see if I can get it working?

Zip it up and rename the file to *.txt and the using the Advanced Editor link above you can attach the file. Or if you agree I can send you an e-mail and you can attach it that way.

I don't think we have a sample java UFL I can use to test here....

Don

0 Kudos

I found this sample and PDF for CR XI on how to. Have a read and see if your UFL is built according to this sample.

Nothing would have changed in CR 2011 for UFL support so it should work, you do need to update the path accordingly...

Rename the attached file to *.zip and then extract to your test folder.

And see this doc for more info also: http://scn.sap.com/docs/DOC-21465

Don

Former Member
0 Kudos

Hello Don,

I tried the sample UFL but it is still not visible the Crystal Report Formulas

I also checked my configuration as suggested in the PDF document but nothing seems to work.

I installed the Microsoft Process Manager and traced the Crystal Report Process.

I saw that the u211java.dll is loaded and even a javamanager.dll.

No jvm.dll and no registry access to the JREPath Key.

So are Java UFLs activated or not?

I attached the log file (ZIP renamed to txt and rezipped again).

Some more questions:

Can I use the JAVA environment from Crystal Report or do I need a separate JRE?

If so which version 1.6 or 1.5 / 32 or 64 bit?

I have installed Windows 7 (64 bit) and Crystal Report is of course 32 bit.

Thanks a lot for your help.

Best regards,

Heiko Tropartz

0 Kudos

Hi Heiko,

Did you go into the Options and enable Java UFL's?

Don

Former Member
0 Kudos

Yes

0 Kudos

Hello,

Is that u211java.jar located in?:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external

Try copying your jar's to the \External folder if you have not done so

Don

Former Member
0 Kudos

Hello Don,

the "u211java.jar" ist part of the system CLASSPATH variable and per default located in:

C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\u211java.jar

I'll try copying our UFL and the "u211java.jar" to the "external" folder.

Thanks,

Heiko Tropartz

Former Member
0 Kudos

Hello Don,

I copied our UFL and "u211java.jar" into the folder:

C:\Program Files (x86)\SAP BusinessC:\Program Files (x86)\SAP BusinessObjects\Crystal Reports 2011\java\lib\external"

I adapted the new file locations in the system CLASSPATH and PATH variable.

I adapted the file locations in the <Classpath> section of the CRConfig.xml file.

Also restarted the machine but the custom java UFL are not visible within Crystal Report.

former_member183750
Active Contributor
0 Kudos

Oh - you may also want to post to the SAP Crystal Reports, version for Eclipse forum or Java SDK Application Development forum. Neither of those forums is a particularly active, but you never know as those forums would be visited by Java developers.

- Ludek

former_member183750
Active Contributor
0 Kudos

Hello Heiko

I looked around to see if there are any resources specific to CR 2011, but all I could find is the same info as you. My suspicion is that unless someone jumps in here, your best bet will be to create a phone case and get this looked at by a support engineer. E.g.; you've done a lot of great research and work on this. Judging from your post, you obviously know what you're doing. So, this may be a bug, or there are some other undocumented steps needed for CR 2011.

Phone cases can be created at this link. And if this turns out to be a bug, etc., your case will be refunded.

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces