如果类型(Array Variant)无法转换为类型(OleStr)

Could not convert variant if type (Array Variant) into type (OleStr)

当尝试从 delphi 动态绑定 TfrxBarCodeView 时出现错误 Could not convert variant if type (Array Variant) into type (OleStr).

var
     barcode: TfrxComponent;
     value  : String;
begin  
  barcode := frxBarcode.FindObject('BarCode1');

  value  := '184577787878';

  if barcode is TfrxBarCodeView then
     TfrxBarCodeView(barcode).BarCode.Text := value;

在 frxBarcode 中我有:

我认为您应该设置条形码视图本身的文本而不是条形码视图的条形码文本,所以:

TfrxBarCodeView(barcode).Text := value;

而不是

TfrxBarCodeView(barcode).BarCode.Text := value;

试图添加参考,但在线文档似乎不存在。但是我在一些我不知道的网站上遇到了 this snippet on the FastReports forum, and this one。两者都使用 TfrxBarCodeView.Text 而不是 TfrxBarCodeView.Barcode.Text.