excel `gettable`中文
This commit is contained in:
parent
4dc02530ba
commit
c536c4d531
|
|
@ -141,7 +141,25 @@ Type xlsxWorkBook = Class
|
|||
Function GetTable(sheet, topLeft, bottomRight);
|
||||
Begin
|
||||
o := GetSheetObj(sheet);
|
||||
if ifObj(o) then return o.Import(topLeft, bottomRight);
|
||||
if ifObj(o) then
|
||||
begin
|
||||
data := o.Import(topLeft, bottomRight, includeHeader, includeIndex, forceSingle);
|
||||
if not TOfficeApi().IsUtf8() then
|
||||
begin
|
||||
fields := fieldnames(data);
|
||||
if ifarray(fields) and length(fields) then
|
||||
begin
|
||||
map := array();
|
||||
for i:=0 to length(fields)-1 do
|
||||
map[fields[i]] := class(TSXml).Utf8ToCurCodePage(fields[i]);
|
||||
reindex(data, nil, map);
|
||||
end
|
||||
data::begin
|
||||
if ifstring(mcell) then mcell := class(TSXml).Utf8ToCurCodePage(mcell);
|
||||
end
|
||||
end
|
||||
return data;
|
||||
end
|
||||
End;
|
||||
|
||||
///创建新sheet
|
||||
|
|
|
|||
Loading…
Reference in New Issue