if k> VarArrayDimCount(v) then raise exception.CreateFmt(ErrTooManyDimensions,[VarName, VarArrayDimCount(v)]);
if (i<VarArrayLowBound(v,k)) or (i>VarArrayHighBound(v,k)) then raise Exception.CreateFmt(ErrIndexOutBounds, [i, VarName,VarArrayLowBound(v,k),VarArrayHighBound(v,k)]);
if (i<VarArrayLowBound(v,1)) or (i>VarArrayHighBound(v,1)) then raise Exception.CreateFmt(ErrIndexOutBounds, [i, VarName,VarArrayLowBound(v,1),VarArrayHighBound(v,1)]);
v:=v[i];
end;
end;
function TFlexCelReport.GetOneBandValue(const v:Variant; const ColOffset: integer; const XF: integer): TOneBandValue;
var
Ds: TDataSet;
DsName, FieldName: string;
VarName, PropIndex: string;
s: widestring;
begin
Result.ValueType:=flv_Value;
Result.Value.Value:=v;
Result.Value.XF:=XF;
Result.CellValue:=v;
Result.ColOffset:= ColOffset;
s:=v;
if copy(s,1,Length(FieldStr))=FieldStr then //It's a field from the database
begin
DsName:=copy(s,Length(FieldStr)+1, Length(s));
DsName:=copy(DsName,1, pos(FieldStr,DsName)-1);
Ds:=(FDataModule.FindComponent(DsName) as TDataSet);
if Ds=nil then Raise Exception.CreateFmt(ErrNoDataSet,[DsName]);