缺少实现此功能的UFL'u2lbcode.dll'

2020-08-25 10:21发布

点击此处---> 群内免费提供SAP练习系统(在群公告中)加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)嗨, 我正在尝试使用 SAP ...

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


嗨,

我正在尝试使用 SAP Crystal Reports(Eclipse版本2.0.24的开发人员版本)开发应用程序。

当我尝试使用条形码运行报告时,出现错误:"

实现此功能的UFL'u2lbcode.dll'丢失"。

我从CRJavaHelper类开始开发了我的应用程序。其他类型的报告也能很好地工作。 在路径

C:\ eclipse \ plugins \ com.businessobjects.crystalreports.crsdk.libs_12.2.225.r3524 \ lib我可以找到该库

com.azalea.ufl.barcode.1.0.jar,我可以在Eclipse的包资源管理器中看到它。 其他信息:

我正在Windows 7 64bit上运行我的项目。

有人可以帮助我吗? 因为我不知道如何解决。

预先感谢


5条回答
95年老男孩
2020-08-25 10:38

感谢您的文档。

我尝试过,但是无法制作UFL文件jar。 因为我从来没有做过,请您能帮我吗?

我执行了以下步骤:

1)在我的新项目中添加外部JAr(CrystalReportsRuntime.jar,CrystalCommon2.jar);

2)我写了代码;

3)我从Eclipse制作了一个jar文件;

4)在上一步中,我将jar文件保存为com.azalea.ufl.barcode.1.0.jar,与原始文件完全相同,并将其放在相同的路径中。

5)我在报表中运行了项目,但是没有用。

这是我编写的代码:

//功能库

package com.azalea.ufl;

import com.crystaldecisions.reports.formulas.FormulaFunction;
import com.crystaldecisions.reports.formulas.FormulaFunctionLibrary;

公共类BarcodeLibrary
实现FormulaFunctionLibrary
{
私有最终FormulaFormFunction [] functionArray = {new Code39(),new Code39Ascii()};

public FormulaFunction getFunction(int functionNumber)
{
返回this.functionArray [functionNumber];
}

public int size()
{
return this.functionArray.length;
}
}

//我的功能

package com.azalea.ufl;

import com.crystaldecisions.reports.common.CrystalResourcesFactory;
import com.crystaldecisions.reports.common.value.FormulaValue;
import com.crystalDecisions .reports.common.value.FormulaValueType;
导入com.crystaldecisions.reports.common.value.StringValue;
import com.crystaldecisions.reports.formulas.FormulaFunction;
import com.crystaldecisions.reports.formulas .FormulaFunctionArgumentDefinition;
导入com.crystaldecisions.reports.formulas.FormulaFunctionCallException;
导入com.crystaldecisions.reports.formulas.FormulaValueReference;
import com.crystaldecisions.reports.formulas.SimpleFormulaFunctionArgumentDefinition;

>公共抽象类Code39Base
实现FormulaFunction
{
FormulaFunctionArgumentDefinition [] myArguments = {SimpleFormulaFunctionArgumentDefinition.string};
受保护的CrystalResourcesFactory resCrystal;

公共Code39Base()
{< br> this.resCrystal = new CrystalResourcesFa ctory(" Messages");
}

受保护的最终字符串doTranslation(String inputData)
{
String returnVal ="";
char [] dataChar = inputData.toCharArray( );
表示(int i = 0; i returnVal = returnVal + translateCharWrapper(dataChar [i]);
}
returnVal =" *" + returnVal +" *";

return returnVal;
}

公共最终FormulaValue评估(FormulaValueReference []参数)
引发FormulaFunctionCallException
{
StringValue dataStringArg =(StringValue)参数[0] .getFormulaValue();

字符串 dataString = dataStringArg.getString();
字符串returnVal = doTranslation(dataString);

return StringValue.fromString(returnVal);
}

public final FormulaFunctionArgumentDefinition [] getArguments( )
{
返回this.myArguments;
}

public final FormulaValueType getReturnType()
{
return FormulaValueType.string;
}

>受保护的抽象字符串translateChar(char paramChar)
引发InvalidBarcodeDataException;

私有字符串translateCharWrapper(char theChar)
{
字符串returnString;
try
{
returnString = translateChar(theChar);
}
catch(I nvalidBarcodeDataException e)
{
returnString ="";
}
return returnString;
}

public void validateArgumentValues(FormulaValueReference []参数)
引发FormulaFunctionCallException < br> {}
}

package com.azalea.ufl;
公共类Code39Ascii
扩展了Code39Base
{
private String [] c39Chars = {""%U"," $ A"," $ B"," $ C"," $ D"," $ E"," $ F"," $ G"," $ H"," $ I"," $ J"," $ K"," $ L"," $ M"," $ N"," $ O"," $ P"," $ Q"," $ R"," $ S"," $ T"," $ U"," $ V"," $ W"," $ X"," $ Y"," $ Z","%A","%B","%C","%D","%E"," _ ","/img/A","/img/B","/img/C","/img/D","/img/E","/img/F","/img/G","/img/H","/img/I","/img/J" ","/img/K","/img/L","-","。","/img/O"," 0"," 1"," 2"," 3"," 4"," 5"," 6"," 7"," 8"," 9","/img/Z","%F","%G","%H","%I","%J","%V", " A"," B"," C"," D"," E"," F"," G"," H"," I"," J"," K"," L"," M" "," N"," O"," P"," Q"," R"," S"," T"," U"," V"," W"," X"," Y", " Z","%K","%L","%M","%N","%O","%W"," + A"," + B"," + C"," + D"," + E"," + F"," + G"," + H"," + I"," + J"," + K"," + L"," + M"," + N"," + O"," + P"," + Q"," + R"," + S"," + T"," + U"," + V"," + W"," + X"," + Y"," + Z","%P","%Q","%R","%S","%T"};

public String getIdentifier( )
{
返回" barcodec39ascii";
}

受保护的字符串translateChar(char theChar)
抛出 validBarcodeDataException
{
如果(theChar> = this.c39Chars.length){
抛出新的InvalidBarcodeDataException(theChar,this.c39Chars.toString());
}
返回this.c39Chars [ theChar];
}
}

//EXCEPTION

package com.azalea.ufl;

公共类InvalidBarcodeDataException扩展了异常{

私有静态最终长型serialVersionUID = 1L;
私有char条形码数据;
私有String allowedCharacters;


公共InvalidBarcodeDataException(字符theBadChar,字符串theAllowedCharacters)
{
this.barcodeData = theBadChar;
this.allowedCharacters = theAllowedCharacters;
}

public String getMessage()
{
返回"无效的条形码数据(" + this.barcodeData +")允许的字符为:" + this.allowedCharacters;
}
}

一周热门 更多>