4 weeks ago - last edited 4 weeks ago
I try to make Java UFL available in Crystal Reports 2020 Designer. I tried 1803967 tutorial but id does not work for me. This tutorial is for several version of Crystal Reports so it is impossible to follow it exactly in each step.
I copied my Java UFL jar to C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib. I had Crystal Report 2016 which was 32 bit, I installed Crystal Reports 2020 and it seems that Crystal Reports 2020 replaced Crystal Reports 2016 and used the same path. I guess that it is a reason why my Crystal Reports uses C:\Program Files (x86) instead of C:\Program Files
2. Create a System Environment Variable "JAVA_HOME"
Variable: JAVA_HOME
Value: C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\jdk
I set JAVA_HOME to C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\sapjvm
3. Create the System Environment Variable "CLASSPATH"
Both the java runtime classes and u211java.jar as well as any UFL classes used need to be on the classpath.
This step is contained in next step
4. All jar file need to be included in CLASSPATH below:
C:\Program Files\SAP BusinessObjects\Crystal Reports 2011\java\lib\external\
commons-collections-3.1.jar
commons-configuration-1.2.jar
commons-lang-2.1.jar
commons-logging.jar
icu4j.jar
C:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external
log4j.jar
C:\Program Files\SAP BusinessObjects\Crystal Reports 2011\java\lib
CrystalFormulas.jar
CrystalReportsSDK.jar
CrystalReportingCommon.jar
u211java.jar
<jufl_dir>\
<your_jufl>.jar
This step cannot be executed exactly because my crystal does not have all libraries. I added all libraries from C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib directory:
I added all libraries from C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external directory. There are 20 libraries.
I added C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\external\log4j.jar and I also tried C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java\lib\CrystalReportsSDK.jar.
5. Add the following String Value at HKEY_LOCAL_MACHINE\SOFTWARE\SAP BusinessObjects\Suite XI 4.0\Crystal Reports
Value name: JREPath
Value data: JREPath needs to point to a 32 bit JDK. e.g. C:\Program Files (x86)\Java\jdk1.8.0_121\jre\bin\client\jvm.dll
Value name: JavaUFLLogging
Value data: <your_jufllog_dir>
Note that for Crystal report 2020 it is 64bit application, it require the 64 bit JDK or JRE.I set JREPath to C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\sapjvm\jre\bin\server\jvm.dll
6. Edit CRConfig.xml
The CRConfig.xml is located in <install_dir>\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\java. To configure your very own Java UFLs, simply place the fully qualified java class names of your libraries between the <classname> tags under the <ExternalFunctionLibraryClassNames> tag, one class name per tag.
For Example,
<ExternalFunctionLibraryClassNames>
<classname>testing.ufl.regression.AnotherFunctionLibrary</classname>
</ExternalFunctionLibraryClassNames>
I have executed this step.
7. Start CR Designer. Change the UFL Support to “Java UFL's Only” by “File->Options->Formula Editor”
I have executed this step.
8. Restart CR Designer. Now you can see your own functions in Formula Workshop.
I have executed this step. My functions are not present Formula Workshop.
My function worked with Crystal Reports 2016, it also worked with older Crystal Reports.
Logs:
getConfigFileName: Configuration file:
getConfigFileName: C:\Program Files (x86)\SAP BusinessObjects\\SAP BusinessObjects Enterprise XI 4.0\java\CRConfig.xml
getClassNamesFromConfigFile: Class name read from config file:
getClassNamesFromConfigFile: com.example.MyBarLib
initializeJVM: Loaded JVMManager.dll
initializeJVM: Loaded JVMManager.dll entry points
initializeJVM: JVMManager's init call succeeded
initializeJVM: Found existing JVM
initializeJVM: Succeeded in attaching to JVM
logClassPath: JVM started with classpath:
logClassPath: .;C:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win64_x64\\jars\;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\CrystalFormulas.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\CrystalReportingCommon.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\JUFLBar.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\u211java.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-beanutils.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-cli-1.2.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-codec.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-collections-3.2.2.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-configuration2-2.2.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-digester-1.6.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-fileupload.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-io.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-jxpath-1.2.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-lang3-3.6.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-logging.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-math-1.1.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\commons-text.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\httpclient5-5.1.3.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\httpcore5-5.1.3.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\icu4j.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\org.apache.httpcomponents.client5.httpclient5-5.1.3.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\org.apache.httpcomponents.core5.httpcore5-5.1.3.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\slf4j-api-1.7.30.jar;C:\Program Files (x86)\SAP BusinessObjects\Crystal Reports\java\lib\external\slf4j-jdk14-1.7.30.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\CrystalReportsSDK.jar
DataTypeConverter::findClass: Found class:
DataTypeConverter::findClass: com/crystaldecisions/reports/common/value/FormulaValueType
getJavaType: Found field id for java type:
getJavaType: number
getJavaType: Found java type:
getJavaType: number
getJavaType: Found field id for java type:
getJavaType: currency
getJavaType: Found java type:
getJavaType: currency
getJavaType: Found field id for java type:
getJavaType: bool
getJavaType: Found java type:
getJavaType: bool
getJavaType: Found field id for java type:
getJavaType: date
getJavaType: Found java type:
getJavaType: date
getJavaType: Found field id for java type:
getJavaType: time
getJavaType: Found java type:
getJavaType: time
getJavaType: Found field id for java type:
getJavaType: dateTime
getJavaType: Found java type:
getJavaType: dateTime
getJavaType: Found field id for java type:
getJavaType: string
getJavaType: Found java type:
getJavaType: string
getJavaType: Found field id for java type:
getJavaType: numberRange
getJavaType: Found java type:
getJavaType: numberRange
getJavaType: Found field id for java type:
getJavaType: currencyRange
getJavaType: Found java type:
getJavaType: currencyRange
getJavaType: Found field id for java type:
getJavaType: dateRange
getJavaType: Found java type:
getJavaType: dateRange
getJavaType: Found field id for java type:
getJavaType: timeRange
getJavaType: Found java type:
getJavaType: timeRange
getJavaType: Found field id for java type:
getJavaType: dateTimeRange
getJavaType: Found java type:
getJavaType: dateTimeRange
getJavaType: Found field id for java type:
getJavaType: stringRange
getJavaType: Found java type:
getJavaType: stringRange
getJavaType: Found field id for java type:
getJavaType: numberArray
getJavaType: Found java type:
getJavaType: numberArray
getJavaType: Found field id for java type:
getJavaType: currencyArray
getJavaType: Found java type:
getJavaType: currencyArray
getJavaType: Found field id for java type:
getJavaType: booleanArray
getJavaType: Found java type:
getJavaType: booleanArray
getJavaType: Found field id for java type:
getJavaType: dateArray
getJavaType: Found java type:
getJavaType: dateArray
getJavaType: Found field id for java type:
getJavaType: timeArray
getJavaType: Found java type:
getJavaType: timeArray
getJavaType: Found field id for java type:
getJavaType: dateTimeArray
getJavaType: Found java type:
getJavaType: dateTimeArray
getJavaType: Found field id for java type:
getJavaType: stringArray
getJavaType: Found java type:
getJavaType: stringArray
getJavaType: Found field id for java type:
getJavaType: numberRangeArray
getJavaType: Found java type:
getJavaType: numberRangeArray
getJavaType: Found field id for java type:
getJavaType: currencyRangeArray
getJavaType: Found java type:
getJavaType: currencyRangeArray
getJavaType: Found field id for java type:
getJavaType: dateRangeArray
getJavaType: Found java type:
getJavaType: dateRangeArray
getJavaType: Found field id for java type:
getJavaType: timeRangeArray
getJavaType: Found java type:
getJavaType: timeRangeArray
getJavaType: Found field id for java type:
getJavaType: dateTimeRangeArray
getJavaType: Found java type:
getJavaType: dateTimeRangeArray
getJavaType: Found field id for java type:
getJavaType: stringRangeArray
getJavaType: Found java type:
getJavaType: stringRangeArray
initializeFunctions: Found java.lang.Exception
initializeFunctions: Found Exception.getMessage()
initializeFunctions: Found com.crystaldecisions.reports.ufltoexternalfunctionbridge.JavaUFLLocator
initializeFunctions: Found JavaUFLLocator.getFunctionInformation()
initializeFunctions: Found com.crystaldecisions.reports.formulas.FormulaFunction
initializeFunctions: Found FormulaFunction.getReturnType()
initializeFunctions: Found FormulaFunction.evaluate()
initializeFunctions: Found com.crystaldecisions.reports.ufltoexternalfunctionbridge.FunctionInformation
initializeFunctions: Found FunctionInformation.functionInstance
initializeFunctions: Found FunctionInformation.returnType
initializeFunctions: Found FunctionInformation.functionDefinitionString
initializeFunctions: Found FunctionInformation.functionExample
initializeFunctions: Found FunctionInformation.functionTemplate
initializeFunctions: Found FunctionInformation.functionLibrary
initializeFunctions: Found FunctionInformation.isImpure
initializeFunctions: Found java.lang.String
initializeFunctions: Allocated array to pass to getFunctionInformation()
initializeFunctions: Class name getting passed to JavaUFLLocator:
initializeFunctions: com.example.MyBarLib
initializeFunctions: getFunctionInformation() returned a null array
initializeFunctions: org/apache/commons/configuration/CompositeConfiguration
User | Count |
---|---|
62 | |
12 | |
7 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.