当尝试从 delphi 动态绑定(bind) TfrxBarCodeView 时,出现错误:如果类型 (Array Variant) 为类型 (OleStr),则无法将变体转换为类型 (OleStr)。
var
barcode: TfrxComponent;
value : String;
begin
barcode := frxBarcode.FindObject('BarCode1');
value := '184577787878';
if barcode is TfrxBarCodeView then
TfrxBarCodeView(barcode).BarCode.Text := value;
在 frxBarcode 中我有:
最佳答案
我认为你应该设置条形码 View 本身的文本而不是条形码 View 的条形码文本,所以:
TfrxBarCodeView(barcode).Text := value;
而不是
TfrxBarCodeView(barcode).BarCode.Text := value;
罢工><罢工>罢工>
尝试添加引用,但在线文档似乎不存在。但我碰到了this snippet在 FastReports 论坛上,以及 this one在一些我不知道的网站上。两者都使用 TfrxBarCodeView.Text
而不是TfrxBarCodeView.Barcode.Text
.
关于delphi - 如果类型 (Array Variant) 无法将变体转换为类型 (OleStr),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58060217/